https://github.com/jonschlinkert/omit-deep
Recursively omit specified keys from an object.
https://github.com/jonschlinkert/omit-deep
deep javascript node nodejs object omit remove
Last synced: 10 months ago
JSON representation
Recursively omit specified keys from an object.
- Host: GitHub
- URL: https://github.com/jonschlinkert/omit-deep
- Owner: jonschlinkert
- License: mit
- Created: 2014-10-06T03:34:10.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2022-06-08T16:09:26.000Z (over 3 years ago)
- Last Synced: 2025-03-31T12:05:36.918Z (11 months ago)
- Topics: deep, javascript, node, nodejs, object, omit, remove
- Language: JavaScript
- Size: 19.5 KB
- Stars: 79
- Watchers: 3
- Forks: 15
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome_frontend_development_resources - omit-deep - Recursively omit specified keys from an object. (Object / React Components)
- awesome - omit-deep - Recursively omit specified keys from an object. (Object / React Components)
README
# omit-deep [](https://www.npmjs.com/package/omit-deep) [](https://npmjs.org/package/omit-deep) [](https://npmjs.org/package/omit-deep) [](https://travis-ci.org/jonschlinkert/omit-deep)
> Recursively omit the specified key or keys from an object.
## Install
Install with [npm](https://www.npmjs.com/):
```sh
$ npm install --save omit-deep
```
## Usage
```js
var omitDeep = require('omit-deep');
var obj = {a: 'a', b: 'b', c: {b: 'b', d: {b: 'b', f: 'f'}}};
console.log(omitDeep(obj, ['b']));
//=> {a: 'a', c: {d: {f: 'f'}}}
var obj = {a: 'a', b: 'b', c: {b: 'b', d: {b: 'b', f: 'f'}}};
console.log(omitDeep(obj, ['b', 'f']));
//=> {a: 'a', c: {d: {}}}
```
Also works with dot-notation:
```js
var obj = {a: 'a', b: 'b', c: {b: 'b', d: {b: 'b', f: 'f'}}};
console.log(omitDeep(obj, ['c.d.b', 'f']));
//=> { a: 'a', b: 'b', c: { b: 'b', d: {} } }
```
## About
### Contributing
Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new).
### Contributors
| **Commits** | **Contributor** |
| --- | --- |
| 18 | [jonschlinkert](https://github.com/jonschlinkert) |
| 2 | [splodingsocks](https://github.com/splodingsocks) |
| 1 | [rikukissa](https://github.com/rikukissa) |
### Building docs
_(This document was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme) (a [verb](https://github.com/verbose/verb) generator), please don't edit the readme directly. Any changes to the readme must be made in [.verb.md](.verb.md).)_
To generate the readme and API documentation with [verb](https://github.com/verbose/verb):
```sh
$ npm install -g verb verb-generate-readme && verb
```
### Running tests
Install dev dependencies:
```sh
$ npm install -d && npm test
```
### Author
**Jon Schlinkert**
* [github/jonschlinkert](https://github.com/jonschlinkert)
* [twitter/jonschlinkert](http://twitter.com/jonschlinkert)
### License
Copyright © 2017, [Jon Schlinkert](https://github.com/jonschlinkert).
Released under the [MIT license](LICENSE).
***
_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.2.1, on January 01, 2017._