1.0.5 • Published 7 years ago

q_ v1.0.5

Weekly downloads
3
License
ISC
Repository
github
Last release
7 years ago

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