Package Exports
- lodash-forget
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 (lodash-forget) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
Lodash forget
missing method
Lodash includes great has
, get
and set
methods, but NOT one that will remove
value with the same recursive way.
Introducing forget
.
It supports same nested syntax as get
, set
and has
in Lodash module and removes appropriate found value.
Installation
npm i lodash-forget --save
How to use
var forget = require('lodash-forget')
, object = { 'a': { 'b': { 'c': 3, 'd': [1, 2] } } };
forget(object, 'a.b.c');
// => { 'a': { 'b': { 'd': [1, 2] } } };
forget(object, 'a.b.d[0]');
// => { 'a': { 'b': { 'd': [2] } } };
forget(object, 'a');
// => {};
// Or use lodash mixin
_.mixin({ forget: forget });