q_

1.0.5 • Public • Published

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

Package Sidebar

Install

npm i q_

Weekly Downloads

1

Version

1.0.5

License

ISC

Last publish

Collaborators

  • antonio.presto