* @param {boolean | undefined} fallback * @returns {Validator}
(fallback)
| 294 | * @returns {Validator} |
| 295 | */ |
| 296 | function boolean(fallback) { |
| 297 | return validator(fallback, (input, keypath) => { |
| 298 | if (typeof input !== 'boolean') { |
| 299 | throw_error(`${keypath} should be true or false, if specified`); |
| 300 | } |
| 301 | return input; |
| 302 | }); |
| 303 | } |
| 304 | |
| 305 | /** |
| 306 | * @param {Array<boolean | string | number>} options |
no test coverage detected