From 129aee2485fee30d8b5a3aa3aa13caffada49581 Mon Sep 17 00:00:00 2001 From: "Alex A. Naanou" Date: Thu, 15 Oct 2020 22:55:36 +0300 Subject: [PATCH] minor tweaks + notes... Signed-off-by: Alex A. Naanou --- diff.js | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/diff.js b/diff.js index 60f9236..c3af5c2 100644 --- a/diff.js +++ b/diff.js @@ -396,14 +396,14 @@ module.ANY = // -> pattern // // This matches null and undefined. -// -// NOTE: this will not match NaN (XXX revise) var NULL = module.NULL = makeCIPattern('NULL', function(obj){ return obj === null - || obj === undefined })() + || obj === undefined + // XXX is this the right way to go? + || isNaN(obj) })() // Bool pattern... @@ -1356,6 +1356,11 @@ module.Types = { // XXX there are two approaches to this: // 1) naive: simply concatenate all the changes in order... // 2) filter and merge changes based on path... + // XXX ...another way to go might be to apply the diffs in sequence + // to an empty object and then reconstruct a single diff from + // the result... + // ...this would require us to do this on both A and B sides, + // i.e. build-then-change... // XXX do we need a conflict resolution policy??? merge: function(diff, other){ // XXX