<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [@empathyco/x-components](./x-components.md) &gt; [deepFlat](./x-components.deepflat.md)

## deepFlat() function

Flat an `Item[]` deeply using the given `childrenKey` to access to his children.

**Signature:**

```typescript
export declare function deepFlat<Item extends {
    [key in Key]?: Item[];
}, Key extends keyof Item>(array: Item[], childrenKey: Key): Item[];
```

## Parameters

|  Parameter | Type | Description |
|  --- | --- | --- |
|  array | Item\[\] | The list of items to flat. Each item may have another list of items of the same type to flat. |
|  childrenKey | Key | Property name where each of the items of the given array may have another list of items to be flattened. |

**Returns:**

Item\[\]

A flat list with all the found items.

