MCPcopy
hub / github.com/directus/directus / toArray

Function toArray

packages/utils/shared/to-array.ts:1–7  ·  view source on GitHub ↗
(val: T | T[])

Source from the content-addressed store, hash-verified

1export function toArray<T = any>(val: T | T[]): T[] {
2 if (typeof val === 'string') {
3 return val.split(',') as unknown as T[];
4 }
5
6 return Array.isArray(val) ? val : [val];
7}

Callers 15

messageConstructorFunction · 0.90
castFunction · 0.90
getTriggersFunction · 0.90
queryToGqlStringFunction · 0.90
loadPanelDataFunction · 0.90
index.tsFile · 0.90
useRelationMultipleFunction · 0.90
index.tsFile · 0.90
index.tsFile · 0.90
index.tsFile · 0.90
constructorMethod · 0.90
loadMethod · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected