.deflate() - DarthJDG/Mangler.js GitHub Wiki
Turns nested objects and arrays into flat objects.
.deflate([options])| Parameter | Type | Default | Description |
|---|---|---|---|
| options | Object | An object containing optional method modifiers. |
Returns a reference to the mangler object itself for chaining.
| Property | Type | Default | Description |
|---|---|---|---|
| limit | Number | 0 |
Limits the depth of processing. Defaults to 0 to completely flatten all objects. |
| transform | String | '_' |
Any transformation supported by the to option of Mangler.transform() to change the case of the flattened property names to. Defaults to snake_case. |
The .deflate() method flattens all objects in the .items[ ] array by calling Mangler.deflate() on each of them. Unless the mangler object is cloned, it will change the original data.
For more details, see the Mangler.deflate() utility function.