@tight/object-extract

0.1.4 • Public • Published

object-extract

Extract nested values from objects:

import extract from '@tight/object-extract';

const object = {
  foo: 'value of foo',
  bar: {
    baz: 'value of bar.baz'
  }
};

extract(object, 'foo'); 
// => value of foo

extract(object, 'foo.bar'); 
// => value of bar.baz

Readme

Keywords

none

Package Sidebar

Install

npm i @tight/object-extract

Weekly Downloads

2

Version

0.1.4

License

MIT

Unpacked Size

2.53 kB

Total Files

6

Last publish

Collaborators

  • anderssvendal