flatMapDeep
Import from @varavel/vdl-plugin-sdk/utils/arrays.
Recursively maps each element in an array using a provided iteratee function and then deeply flattens the resulting array.
Type Parameters
| Type Parameter | Description |
|---|---|
T |
The type of elements within the array. |
U |
The type of elements within the returned array from the iteratee function. |
Parameters
| Parameter | Type | Description |
|---|---|---|
arr |
readonly T[] |
The array to flatten. |
iteratee |
(item, index, array) => U |
The function that produces the new array elements. It receives the element, its index, and the array. |
Returns
ExtractNestedArrayType\<U>[]
A new array that has been flattened.