mirror of
https://github.com/directus/directus.git
synced 2026-02-12 23:35:06 -05:00
* Move accountability type to shared * Rely on shared for parse-filter * Install date-fns * Support dynamic variables in conditional fields Closes #7157
8 lines
177 B
TypeScript
8 lines
177 B
TypeScript
export function toArray<T = any>(val: T | T[]): T[] {
|
|
if (typeof val === 'string') {
|
|
return val.split(',') as unknown as T[];
|
|
}
|
|
|
|
return Array.isArray(val) ? val : [val];
|
|
}
|