object-only
v1.0.0
Published
Extract a copy of the object containing the specified properties
Downloads
2
Readme
object-only
Extract a copy of the object containing the specified properties.
Install
$ npm install --save object-only
Example
var objectOnly = require('object-only');
var obj = {
bar: 'foo',
foo: {
bar: 'foo'
},
foobar: 'foobar'
};
console.log(objectOnly(obj, ['bar', 'foo.bar']));
// { bar: 'foo', foo: { bar: 'foo' } }
License
MIT © Fredrik Forsmo