MCPcopy Create free account
hub / github.com/Snaacky/theindex / parseDataToBooleanOrUndefined

Function parseDataToBooleanOrUndefined

components/data/DataItem.tsx:15–28  ·  view source on GitHub ↗
(
  input: boolean | string | string[] | undefined | null
)

Source from the content-addressed store, hash-verified

13}
14
15function 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
30function parseDataToArray(
31 input: boolean | string | string[] | undefined | null

Callers 1

DataItemFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected