undo-nested
v1.0.4
Published
Extract any nested value from into a flat array
Downloads
2
Maintainers
Readme
What is?
Undo Nest, is a JavaScript Library for dealing with nested values
Installation
Using the package manager Yarn to install undo-nested.
yarn add undo-nested
Using the package manager npm to install undo-nested.
npm install undo-nested
Usage
import { undoNested } from 'undo-nested'
undoNested([1, [2, 3], [[4]]]) # returns [1, 2, 3, 4]
undoNested({name: 'Rick Sanchez', family: { name: 'Morty Smith' }}) # returns ['Rick Sanchez', 'Morty Smith']
undoNested(['Rick Sanchez', {age: 70}]) # returns ['Rick Sanchez', 70]
Contributing
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
Please make sure to update tests as appropriate.