Package Exports
- unsafe-set
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 (unsafe-set) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
unsafe-set
Unsafely set a value at a property, creating intermediate properties if necessary. If one doesn't exist, or exists but isn't an object, it will become an object. Does not support intermediate arrays like lodash.set. Returns the original, modified object.
- tiny
- no dependencies
import set from 'unsafe-set';
let obj = {
a: 'foo'
}
set(obj, 'a.aa.aaa', 'bar');
//{a: {aa: {aaa: 'bar'}}}