Share your code. npm Orgs help your team discover, share, and reuse code. Create a free org »

inner

0.2.0 • Public • Published

Inner

Get and set values in deeply nested objects.

Installation

npm install inner

Usage

var inner = require('inner');
var object = {
  user: {
    name: 'John',
    friends: ['Mike', 'Alex']
  }
};
 
inner.get(object, ['user', 'friends', '0']); // -> 'Mike'
inner.set(object, ['user', 'name'], 'Chris'); // object.user.name == 'Chris'
inner.has(object, ['user', 'friends', '1']); // -> true

Credits

Inner is just like this library, but with support for specifying nested properties as arrays instead of strings.

Keywords

none

install

npm i inner

Downloadsweekly downloads

452

version

0.2.0

license

MIT

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar