Function
parseDataToBooleanOrUndefined
(
input: boolean | string | string[] | undefined | null
)
Source from the content-addressed store, hash-verified
| 13 | } |
| 14 | |
| 15 | function parseDataToBooleanOrUndefined( |
| 16 | input: boolean | string | string[] | undefined | null |
| 17 | ) { |
| 18 | if (typeof input === 'boolean' || typeof input === 'undefined') { |
| 19 | return input |
| 20 | } |
| 21 | if (input === null) { |
| 22 | return undefined |
| 23 | } |
| 24 | if (input.length === 0) { |
| 25 | return undefined |
| 26 | } |
| 27 | return true |
| 28 | } |
| 29 | |
| 30 | function parseDataToArray( |
| 31 | input: boolean | string | string[] | undefined | null |
Tested by
no test coverage detected