@utilify/core
Version:
Modern, strongly typed, and safe utility function library for JavaScript and TypeScript. Includes type checking, manipulation of arrays, objects, strings, dates, colors, numbers, regular expressions, and more. Compatible with Browser, Node.js, Deno, and B
10 lines • 425 B
TypeScript
/**
* Flattens an array up to a specified depth.
* @template T
* @param {T[]} array - The array to flatten.
* @param {number} [depth=Infinity] - The depth to flatten.
* @returns {FlatArray<T[], number>[]} The flattened array.
* @throws {TypeError} If array is not an array or depth is invalid.
*/
export default function flat<T>(array: T[], depth?: number): FlatArray<T[], number>[];
//# sourceMappingURL=flat.d.ts.map