https://github.com/codewell/exclude-keys-js
Exclude a key from JSON
https://github.com/codewell/exclude-keys-js
Last synced: 4 days ago
JSON representation
Exclude a key from JSON
- Host: GitHub
- URL: https://github.com/codewell/exclude-keys-js
- Owner: codewell
- License: mit
- Created: 2020-05-06T13:02:37.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2023-03-04T16:34:24.000Z (over 3 years ago)
- Last Synced: 2025-11-11T19:34:44.552Z (7 months ago)
- Language: JavaScript
- Size: 1.14 MB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# @codewell/exclude-keys
Exclude keys from JavaScript objects.
## Installation
```
npm install @codewell/exclude-keys
```
## Basic Usage
```JavaScript
import excludeKeys from '@codewell/exclude-keys';
const object = { one: 1, two: 2, three: 3 };
// Exclude several keys
excludeKeys(object, 'one');
// => { two: 2, three: 3 }
excludeKeys(object, 'one', 'two');
// => { three: 3 }
excludeKeys(object, 'one', 'three');
// => { two: 2 }
excludeKeys(object, 'one', 'two', 'three');
// => {}
excludeKeys(object, 'two');
// => { one: 1, three: 3 }
excludeKeys(object, 'two', 'three');
// => { one: 1 }
excludeKeys(object, 'three');
// => { one: 1, two: 2 }
```
## Contribution
Please help by submitting issues and pull requests here on github
Read more on [codewell's webpage](https://codewell.github.io/contribution)