UNPKG

codetrix

Version:

A lightweight lodash-style utility library

12 lines (11 loc) 312 B
/** * Flattens a nested array into a single-level array. * * @template T The type of array elements. * @param array The nested array to flatten. * @returns A new flattened array. * * @example * flatten([1, [2, [3, 4]], 5]); // [1, 2, [3, 4], 5] */ export declare function flatten<T>(array: any[]): T[];