minor tweaks + notes...

Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
Alex A. Naanou 2020-10-15 22:55:36 +03:00
parent 3be394b85d
commit 129aee2485

11
diff.js
View File

@ -396,14 +396,14 @@ module.ANY =
// -> pattern // -> pattern
// //
// This matches null and undefined. // This matches null and undefined.
//
// NOTE: this will not match NaN (XXX revise)
var NULL = var NULL =
module.NULL = module.NULL =
makeCIPattern('NULL', makeCIPattern('NULL',
function(obj){ function(obj){
return obj === null return obj === null
|| obj === undefined })() || obj === undefined
// XXX is this the right way to go?
|| isNaN(obj) })()
// Bool pattern... // Bool pattern...
@ -1356,6 +1356,11 @@ module.Types = {
// XXX there are two approaches to this: // XXX there are two approaches to this:
// 1) naive: simply concatenate all the changes in order... // 1) naive: simply concatenate all the changes in order...
// 2) filter and merge changes based on path... // 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??? // XXX do we need a conflict resolution policy???
merge: function(diff, other){ merge: function(diff, other){
// XXX // XXX