MCPcopy Create free account
hub / github.com/BridgeAR/safe-stable-stringify / getBooleanOption

Function getBooleanOption

index.js:167–176  ·  view source on GitHub ↗
(options, key, defaultValue)

Source from the content-addressed store, hash-verified

165}
166
167function getBooleanOption (options, key, defaultValue) {
168 let value
169 if (hasOwnProperty.call(options, key)) {
170 value = options[key]
171 if (typeof value !== 'boolean') {
172 throw new TypeError(`The "${key}" argument must be of type boolean`)
173 }
174 }
175 return value === undefined ? defaultValue : value
176}
177
178function getPositiveIntegerOption (options, key) {
179 let value

Callers 1

configureFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected