mirror of https://github.com/ctk-hq/ctk
refactor(frontend): moved `checkArray` function to utils module
parent
c06f688cf3
commit
61344ff300
@ -0,0 +1,8 @@
|
|||||||
|
export const checkArray = <T>(array: any, name: string): T => {
|
||||||
|
if (!Array.isArray(array)) {
|
||||||
|
throw new Error(
|
||||||
|
`Looks like we encountered a bug. The current implementation expects "${name}" to be an array.`
|
||||||
|
);
|
||||||
|
}
|
||||||
|
return array as unknown as T;
|
||||||
|
};
|
||||||
Loading…
Reference in New Issue