UNPKG

@web3r/flowerkit

Version:

Tree-shakable JavaScript and TypeScript utility library for frontend/browser apps: DOM, events, arrays, objects, strings, date, JSON, and network helpers (ESM/CJS, SSR-friendly).

16 lines (15 loc) 544 B
export type TIsNonEmptyArrArgs = Parameters<typeof isNonEmptyArr>; export type TIsNonEmptyArrReturn = ReturnType<typeof isNonEmptyArr>; /** * Check if an object is non-empty array * @template T * @param {unknown} arr * @returns {arr is Array<T>} * @example * // How to check if an array is valid (non-empty)? * const myArr = [ 1, 2, 3 ]; * console.log(isNonEmptyArr(myArr)); // => true * const myObj = "string"; * console.log(isNonEmptyArr(myObj)); // => false */ export declare const isNonEmptyArr: <T>(arr: unknown) => arr is T[];