Files
twenty/front/src/utils/isNonEmptyArray.ts
Lucas Bordeau 547a17b145 Feat/metadata add update and delete on frontend (#2102)
* Reworked metadata creation

* Wip

* Fix from PR

* Removed consolelog

* Post merge

* Fixed seeds
2023-10-18 16:48:11 +02:00

14 lines
281 B
TypeScript

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;
};