del-object-path
v0.1.0
Published
Delete given (deep) object path
Downloads
34,098
Readme
del-object-path
Del given (deep) object path
See also: get-object-path, set-object-path
Install
$ npm install del-object-path
Usage
var del = require('del-object-path')
var data = {
title: 'My Products',
products: {
eggs: [{ kind: 'white', amount: 300 }, { kind: 'brown', amount: 200 }]
}
}
del(data, 'products.eggs[0].amount')
data.products.eggs[0].amount
// => undefined
del(data, 'products.eggs')
Object.keys(data.products)
// => ['title']