Files
world/book/node_modules/omit-keys/README.md
2025-05-12 05:38:44 +09:00

66 lines
1.1 KiB
Markdown

# omit-keys [![NPM version](https://badge.fury.io/js/omit-keys.svg)](http://badge.fury.io/js/omit-keys)
> Return a copy of an object without the given keys.
## Install
#### Install with [npm](npmjs.org):
```bash
npm i omit-keys --save-dev
```
## Run tests
```bash
npm test
```
## Usage
```js
var omitKeys = require('omit-keys');
```
Pass a string `key` to omit:
```js
omit({a: 'a', b: 'b', c: 'c'}, 'a')
//=> { b: 'b', c: 'c' }
```
Pass an array of `keys` to omit:
```js
omit({a: 'a', b: 'b', c: 'c'}, ['a', 'c'])
//=> { b: 'b' }
```
Returns the object if no keys are passed:
```js
omit({a: 'a', b: 'b', c: 'c'})
//=> {a: 'a', b: 'b', c: 'c'}
```
Returns an empty object if no value is passed.
```js
omit()
//=> {}
```
## Author
**Jon Schlinkert**
+ [github/jonschlinkert](https://github.com/jonschlinkert)
+ [twitter/jonschlinkert](http://twitter.com/jonschlinkert)
## License
Copyright (c) 2014 Jon Schlinkert, contributors.
Released under the MIT license
***
_This file was generated by [verb-cli](https://github.com/assemble/verb-cli) on September 22, 2014._