(options, key, defaultValue)
| 165 | } |
| 166 | |
| 167 | function 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 | |
| 178 | function getPositiveIntegerOption (options, key) { |
| 179 | let value |