crush-array

1.0.0 • Public • Published

Crush-array

Crush-array lets you completely flatten an object, duplicating each of its item anytime an array property is detected.

Starts with WHY

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.

users.forEach(user => {
    user.friends.forEach(friend => {
        if (!friend.bestFriendId) {
 
        }
    })
})

Installing

Installation via npm is straightforward:

npm i dewind

Running the tests

cd yourself at the root of the project directory and then:

npm test

Examples

Explain what these tests test and why

Give an example

Contributing

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

License

This project is licensed under the MIT License - see the LICENSE.md file for details

Acknowledgments

  • Inspired by the MongoDB's unwind function and common Flatten behavior

Package Sidebar

Install

npm i crush-array

Weekly Downloads

1

Version

1.0.0

License

MIT

Unpacked Size

134 kB

Total Files

15

Last publish

Collaborators

  • radioreve