1.0.5 • Published 7 years ago

decompose.js v1.0.5

Weekly downloads
4
License
MIT
Repository
github
Last release
7 years ago

decompose.js

Build Status

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                                      ]
// ]
1.0.5

7 years ago

1.0.4

7 years ago

1.0.3

7 years ago

1.0.2

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago

0.0.0

7 years ago