JSPM

del-object-path

0.1.0
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 11905
  • Score
    100M100P100Q140629F
  • License BSD

Delete given (deep) object path

Package Exports

  • del-object-path

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (del-object-path) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

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']