q_
v1.0.5
Published
Tiny helper to navigation into objects
Downloads
9
Maintainers
Readme
Safe navigation into objects
npm install --save q_
const q = require('q_');
const object = {
a: {
b: {
c: {
d: 1,
array: ['foo', 'bar'],
},
},
},
};
q(object, 'a.b.c.d'); // => 1
q(object, 'a.b.c.array[1]'); // => bar
q(object, 'foo'); // => undefined