- Breaking change: the previous default export is now called
wrap()
- Possible breaking change:
object-path-immutable
now uses ES modules which means if you are in an ESM environment you will have to use named exports.
- Possible breaking change
merge
not does not accept options anymore - Removed dependency on
deepmerge
- Possible breaking change The library now has dependencies and is building with Rollup, therefore the UMD entry point is now
dist/object-path-immutable
. If you are using thisobject-path-immutable
with Node or another module bundler, this change should not affect you. - Added
merge
function
- Breaking change: The way the library handles empty paths has changed. Before this change,all the methods were returning the original object. The new behavior is as follows.
set(src, path, value)
:value
is returnedupdate(src, path, updater)
:value
will be passed toupdater()
and the result returnedset(src, path, ...values)
:values
will be concatenated tosrc
ifsrc
is an array, otherwisevalues
will be returnedinsert(src, path, value, at)
: ifsrc
is an array then it will be cloned andvalue
will be inserted atat
, otherwise[value]
will be returneddel(src, path)
: returnsundefined
assign(src, path, target)
: Target is assigned to a clone ofsrc
and returned