|
|
@ -19,6 +19,7 @@ const wrapPath = require("@validatem/wrap-path"); |
|
|
|
// FIXME: Prevent prototype pollution
|
|
|
|
// FIXME: Figure out an ergonomic way to do nested array merging (ie. flattening)
|
|
|
|
// FIXME: Figure out a better way to pass around the options, that doesn't 'leak' to custom functions
|
|
|
|
// TODO: Add an option for removing deleted keys (rather than just setting them to `undefined`)
|
|
|
|
|
|
|
|
// FIXME: Make sure to explain the purpose of this in the documentation (multi-step merging, like in zapdb)
|
|
|
|
let DeleteValue = Symbol("DeleteValue"); |
|
|
@ -128,6 +129,12 @@ function mergeValue(rule, a, b, path, options) { |
|
|
|
|
|
|
|
module.exports = { |
|
|
|
DeleteValue: DeleteValue, // FIXME: Test this
|
|
|
|
Recursive: function (mergeFunc) { |
|
|
|
return { |
|
|
|
__mergeByTemplateOperation: "recursive", |
|
|
|
mergeFunc: mergeFunc |
|
|
|
}; |
|
|
|
}, |
|
|
|
createMerger: function createMerger(_template, _options) { |
|
|
|
let [ template, options ] = validateArguments(arguments, { |
|
|
|
template: [], |
|
|
|