1.1.0 • Published 7 years ago

delete-key v1.1.0

Weekly downloads
9
License
MIT
Repository
github
Last release
7 years ago

Installation

Node.js

npm install delete-key --save

Example

const deleteKey = require('delete-key');

const targetObj = {a: 4, b: 5, d: {a: 1}};

deleteKey(targetObj, ['b, d']);

console.log(targetObj); //=> {a: 4};

Deletes recursively

const targetObj = {a: 4, b: 5, d: {a: 1}};

deleteKey(targetObj, ['b, a'], true);

console.log(targetObj); //=> {a: 4, d: {}};

Copy target object

const targetObj = {a: 4, b: 5, d: {a: 1}};

const newTargetObject = deleteKey.copy(targetObj, ['b, a'], true);

console.log(targetObj); //=> {a: 4, b: 5, d: {a: 1}};
console.log(newTargetObject); //=> {a: 4, d: {}};

Changelog

You can view the changelog here

License

delete-key is open-sourced software licensed under the MIT license

Author

Fabio Ricali

1.1.0

7 years ago

1.0.4

7 years ago

1.0.3

7 years ago

1.0.2

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago