The source iterable.
Returns a new IEnumerable with all sub-iterable elements concatenated into it recursively up to the specified depth.
const items = [1, 2, [3, 4, [5, []]]];
const res = from(items).flatten(2); // [1, 2, 3, 4, 5, []]
TSource The type of the source iterable.
A new IEnumerable with all sub-iterable elements concatenated into it recursively up.
The source iterable.
The depth to flatten to.
Generated using TypeDoc
Returns a new IEnumerable with all sub-iterable elements concatenated into it one level deep.
Example
Typeparam
TSource The type of the source iterable.
Returns
A new IEnumerable with all sub-iterable elements concatenated into it recursively up.