npm.io
0.0.4 • Published 4 years ago

delete-object-property

Licence
MIT
Version
0.0.4
Deps
0
Size
42 kB
Vulns
0
Weekly
0

Delete Object Property

GitHub Workflow Status npm GitHub

Small utility to remove a property from a complex object using strings. Several other packages already exist for this purpose, but I wanted my own :)

Installation

npm i delete-object-property

Usage

Works with both objects and arrays.

const object = {
  foo: 'bar',
  bar: {
    baz: 'lorem ipsum',
  },
};

const result = deleteProperties(object, 'bar.baz');

// This will output { foo: 'bar' }
console.log(result);

Plans

Not much yet