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

Function parseDataToArray

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

Source from the content-addressed store, hash-verified

28}
29
30function parseDataToArray(
31 input: boolean | string | string[] | undefined | null
32) {
33 if (input === null || typeof input === 'undefined') {
34 return []
35 }
36 if (typeof input === 'boolean') {
37 return []
38 }
39 if (Array.isArray(input)) {
40 return input
41 }
42 if (input.length > 0) {
43 return [input]
44 }
45 return []
46}
47
48function parseDataToString(
49 input: boolean | string | string[] | undefined | null

Callers 1

DataItemFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected