Omit properties from an object or deeply nested property of an object using object path notation.
Install with npm
$ npm i omit-value --save
var omit = require('omit-value');
omit a nested value:
var obj = {foo: {a: 'b', c: 'd'}, bar: {x: 'y'}}; omit(obj, 'foo'); //=> {bar: {x: 'y'}}
omit a nested value:
var obj = {foo: {a: 'b', c: 'd'}}; omit(obj, 'foo', 'a'); // obj.foo ==> {c: 'd'}
omit a deeply nested value:
var obj = {foo: {bar: {baz: {a: 'b', c: 'd'}}}} omit(obj, 'foo.bar.baz', 'c'); // obj.foo.bar.baz ==> {a: 'b'}
omit multiple deeply nested values:
var obj = {foo: {bar: {baz: {a: 'b', c: 'd', e: 'f', g: 'h'}}}} omit(obj, 'foo.bar.baz', ['a', 'c', 'g']); // obj.foo.bar.baz ==> {e: 'f'}
a.b.c
) to get a nested value from an object.'a.b.c'
) paths.Install dev dependencies:
Pull requests and stars are always welcome. For bugs and feature requests, please create an issue
Jon Schlinkert
Copyright © 2015 Jon Schlinkert Released under the MIT license.
This file was generated by verb-cli on July 08, 2015.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4