twenty / packages /twenty-shared /src /utils /array /isNonEmptyArray.ts
Jules
Initial clean CRM deployment with prebuilt assets
d9494a5
Raw
History Blame Contribute Delete
335 Bytes
import { isNumber } from '@sniptt/guards';
export const isNonEmptyArray = <T>(
probableArray: T[] | readonly T[] | undefined | null,
): probableArray is NonNullable<T[]> => {
if (
Array.isArray(probableArray) &&
isNumber(probableArray.length) &&
probableArray.length > 0
) {
return true;
}
return false;
};