Skip to content

0.3.0 bye bye DEL/SUB, hello (x => x) and undefined

Compare
Choose a tag to compare
@fuzetsu fuzetsu released this 07 Aug 17:08
· 9 commits to master since this release

This versions contains breaking changes:

DEL is no longer exported, specify undefined as the value to delete properties, use null if you don't want to delete

// before
merge({ prop: true }, { prop: DEL })

// now
merge({ prop: true }, { prop: undefined })

SUB is only used to perform replacements and sidestep recursive logic, directly set a function as the value in order to perform a function substitution

// before
merge({ count: 1, nest: { foo: 'bar' } }, { count: SUB(x => x + 1), nest: SUB({}) }

// now
merge({ count: 1, nest: { foo: 'bar' } }, { count: x => x + 1, nest: SUB({}) }

This release also contains 1 bug fix. Previously SUB operations nested into a path that didn't exist in the source object would be copied in unresolved, leaving mergerino artifacts in state. This has been fixed.