UNPKG

@monstermann/fn

Version:

A utility library for TypeScript.

22 lines (20 loc) 341 B
import { dfdlT } from "@monstermann/dfdl"; //#region src/array/length.ts /** * `length(array)` * * Returns the number of elements in `array`. * * ```ts * length([1, 2, 3, 4]); // 4 * ``` * * ```ts * pipe([1, 2, 3, 4], length()); // 4 * ``` */ const length = dfdlT((target) => { return target.length; }, 1); //#endregion export { length };