first commit
This commit is contained in:
9
calcom/apps/web/lib/ensureArray.ts
Normal file
9
calcom/apps/web/lib/ensureArray.ts
Normal file
@@ -0,0 +1,9 @@
|
||||
export function ensureArray<T>(val: unknown): T[] {
|
||||
if (Array.isArray(val)) {
|
||||
return val;
|
||||
}
|
||||
if (typeof val === "undefined") {
|
||||
return [];
|
||||
}
|
||||
return [val] as T[];
|
||||
}
|
||||
Reference in New Issue
Block a user