From 635bac4b3235fa45d34489de479ec4a861c2d2ac Mon Sep 17 00:00:00 2001 From: Sven Slootweg Date: Tue, 10 Jan 2023 19:10:25 +0100 Subject: [PATCH] Add note --- index.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/index.js b/index.js index 50562c6..b3beea1 100644 --- a/index.js +++ b/index.js @@ -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: [],