mirror of
https://github.com/chenasraf/dotfiles.git
synced 2026-05-17 17:28:07 +00:00
5 lines
184 B
TypeScript
5 lines
184 B
TypeScript
export function asArray<T extends any[]>(value: T | T[0]): T {
|
|
if (value === null || value === undefined) return [] as any
|
|
return Array.isArray(value) ? value : ([value] as any)
|
|
}
|