https://github.com/jondotsoy/decompose.js
Decompose a object.
https://github.com/jondotsoy/decompose.js
javascript javascript-library javascript-objects
Last synced: about 2 months ago
JSON representation
Decompose a object.
- Host: GitHub
- URL: https://github.com/jondotsoy/decompose.js
- Owner: JonDotsoy
- License: mit
- Created: 2017-02-25T01:02:52.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2017-05-14T21:20:32.000Z (about 8 years ago)
- Last Synced: 2025-03-18T05:59:09.349Z (2 months ago)
- Topics: javascript, javascript-library, javascript-objects
- Language: JavaScript
- Homepage:
- Size: 97.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
> # :warning: this branch is on develop.
---
# decompose.js 🎼
[](https://travis-ci.org/JonDotsoy/decompose.js)
[](https://www.npmjs.com/package/decompose.js)Decompose a object.
> Why? In some cases it is necessary to inspect an object in depth and have the full value despite being able to modify it later. This project is well for inspecting an object to depth and detailing all its values.
## Inspiration
Read the next publicactión on [stackoverflow][stackoverflow-questions-8318357].
Would not it be great to know everything about an object? — This library allows it!!.## Example
```javascript
const { decompose } = require('decompose.js')const myObj = { a: { b: 0 }, c: [ { d: 1 }, { e: true } ] }
decompose( myObj ) // => Array
// [
// [ [] , {"a":{"b":0},"c":[{"d":1},{"e":true}]} ],
// [ ["a"] , {"b":0} ],
// [ ["a","b"] , 0 ],
// [ ["c"] , [{"d":1},{"e":true}] ],
// [ ["c","0"] , {"d":1} ],
// [ ["c","0","d"] , 1 ],
// [ ["c","1"] , {"e":true} ],
// [ ["c","1","e"] , true ],
// [ ["c","length"] , 2 ]
// ]
```[stackoverflow-questions-8318357]: http://stackoverflow.com/questions/8318357/javascript-pointer-reference-craziness-can-someone-explain-this "Javascript pointer/reference craziness. Can someone explain this?"