get-single-obj-prop

Quickly navigate to a single property in a complex object

Usage no npm install needed!

<script type="module">
  import getSingleObjProp from 'https://cdn.skypack.dev/get-single-obj-prop';
</script>

README

get-single-obj-prop

Quickly navigate to a single property in a complex object. Based on this

Install

$ npm install get-single-obj-prop

Usage

const getSingleObjProp = require('get-single-obj-prop');

const obj = {
  a: {
    b: {
      c: 'test',
    },
  },
};

getSingleObjProp(obj, 'a.b.c'); //=> 'test'

License

MIT © Carl Mungazi