deep-keys
Creates an array composed of the own enumerable property names(including nested) of an object.
Note: This kit works great with obj-parse (get and set object properties in a fast and elegant way).
Install
$ npm install --save deep-keys
Usage
deepKeys(obj, intermediate[optional])
var deepKeys = require('deep-keys');
var obj1 = {
a: 1,
b: { c: 1 },
c: { d: { e: 1 }, f: 1 },
d: { e: { f: { g: 1, h: 2 } } },
e: 2,
f: { g: [] }
};
deepKeys(obj1);
var obj2 = {
type: 'customer',
details: {
name: 'Ariel', age: 26, address: { city: 'Tel Aviv', country: 'Israel' }
},
isActive: true
};
deepKeys(obj2);
var obj3 = {a:{b:{c:1}}};
deepKeys(obj3);
deepKeys(obj3, true);
var obj4 = { 'a.': { b: 1} };
deepKeys(obj4)
License
MIT © Ariel Mashraki