1.0.5 • Published 7 years ago
decompose.js v1.0.5
decompose.js
Decompose a object.
Inspiration
read the next publicactión on stackoverflow. Would not it be great to know everything about an object? — This library allows it!!.
Example
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 ]
// ]