UNPKG

@antv/util

Version:

<h1 align="center">@antv/util</h1>

12 lines (11 loc) 294 B
/** * Flattens `array` a single level deep. * * @param {Array} arr The array to flatten. * @return {Array} Returns the new flattened array. * @example * * flatten([1, [2, [3, [4]], 5]]); // => [1, 2, [3, [4]], 5] */ declare const flatten: <T>(arr: T[]) => T[]; export default flatten;