From b77bfb03ee1c55092e0167d04ec1ee044b9526cf Mon Sep 17 00:00:00 2001 From: "Alex A. Naanou" Date: Thu, 2 Aug 2018 16:04:41 +0300 Subject: [PATCH] notes... Signed-off-by: Alex A. Naanou --- diff.js | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/diff.js b/diff.js index b7c9f13..b95c00a 100644 --- a/diff.js +++ b/diff.js @@ -996,12 +996,19 @@ module.Types = { // XXX make this an extensible walker... - // ...ideally passed a func(A, B, obj, handle(action, value)) where: + // ...ideally passed a func(A, B, obj, ...) where: // A - change.A // B - change.B // obj - object at change.path - // action - action to perform ('replace', 'return', ...) - // value - action argument... + // func(..) should be able to: + // - replace obj with B (patch) + // ...current implementation of .patch(..) + // - check obj against B (check) + // - swap A and B (reverse) ??? + // - ... + // one way to do this is to pass func(..) a handler that it + // would call to control the outcome... + // ...still needs thought, but this feels right... _walk: function(diff, obj, options){ var that = this var NONE = diff.placeholders.NONE