Crushing a deeply nested collection into a collection of flat objects
npm install crush-arrayCrush-array lets you completely flatten an object, duplicating each of its
item anytime an array property is detected.
Crush-array's primarily intent is to escape the cascade of "each/if"
that regularly happen when working with complex collections of objets
and nested properties.
``javascript
users.forEach(user => {
user.friends.forEach(friend => {
if (!friend.bestFriendId) {
}
})
})
`
Installation via npm is straightforward:
``
npm i dewind
cd yourself at the root of the project directory and then:
``
npm test
Explain what these tests test and why
```
Give an example
Feel free to open a pull request if you like the module and wants to improve its quality
No guidelines, just make sure the linter is all green as well as all adequate tests
This project is licensed under the MIT License - see the LICENSE.md file for details
* Inspired by the MongoDB's unwind function and common Flatten behavior