immutable-delete
v1.1.0
Published
Remove a key from an object without mutating it
Downloads
98
Readme
Immutable Delete
A simple function that shallow copies an object, excluding one of its keys.
Usage
npm install immutable-delete
var immutableDelete = require("immutable-delete");
var originalObject = { key1: "value1", key2: "value2" };
console.log(immutableDelete(originalObject, "key1"));
// { key2: "value2" }
console.log(originalObject);
// { key1: "value1", key2: "value2" }
<script src="dist/immutable-delete.min.js"></script>
Tests
npm test