Files
twenty/front/src/utils/isNonEmptyArray.ts
Charles Bochet 6ced8434bd Uniformize folder structure (#693)
* Uniformize folder structure

* Fix icons

* Fix icons

* Fix tests

* Fix tests
2023-07-16 14:29:28 -07:00

14 lines
262 B
TypeScript

export function isNonEmptyArray<T>(
probableArray: T[] | undefined | null,
): probableArray is NonNullable<T[]> {
if (
Array.isArray(probableArray) &&
probableArray.length &&
probableArray.length > 0
) {
return true;
}
return false;
}