MCPcopy Create free account
hub / github.com/sindresorhus/execa / checkBooleanOption

Function checkBooleanOption

lib/stdio/type.js:111–115  ·  view source on GitHub ↗
(value, optionName)

Source from the content-addressed store, hash-verified

109};
110
111export const checkBooleanOption = (value, optionName) => {
112 if (value !== undefined && typeof value !== 'boolean') {
113 throw new TypeError(`The \`${optionName}\` option must use a boolean.`);
114 }
115};
116
117const isGenerator = value => isAsyncGenerator(value) || isSyncGenerator(value);
118export const isAsyncGenerator = value => Object.prototype.toString.call(value) === '[object AsyncGeneratorFunction]';

Callers 3

validateNonGeneratorTypeFunction · 0.85
getGeneratorObjectTypeFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected