Migrate to a monorepo structure (#2909)
This commit is contained in:
13
packages/twenty-front/src/utils/isNonEmptyArray.ts
Normal file
13
packages/twenty-front/src/utils/isNonEmptyArray.ts
Normal file
@ -0,0 +1,13 @@
|
||||
export const isNonEmptyArray = <T>(
|
||||
probableArray: T[] | readonly T[] | undefined | null,
|
||||
): probableArray is NonNullable<T[]> => {
|
||||
if (
|
||||
Array.isArray(probableArray) &&
|
||||
probableArray.length &&
|
||||
probableArray.length > 0
|
||||
) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
};
|
||||
Reference in New Issue
Block a user