/delete-object-property

Small utility to remove a property from a complex object using strings.

Primary LanguageTypeScriptMIT LicenseMIT

🗑️ 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