From 30573a793956a79bc227d6beafbc7dfbfc80d3ad Mon Sep 17 00:00:00 2001 From: "Alex A. Naanou" Date: Thu, 1 Jul 2021 16:39:12 +0300 Subject: [PATCH] notes... Signed-off-by: Alex A. Naanou --- diff2.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/diff2.js b/diff2.js index fd0aef6..a51d853 100644 --- a/diff2.js +++ b/diff2.js @@ -101,6 +101,7 @@ module.CONTENT = // // XXX need to think about extension use-cases... // XXX should we move this to a separate lib??? +// XXX add a way to do relative/full paths... var Walk = module.Walk = object.Constructor('Walk', { @@ -153,6 +154,7 @@ object.Constructor('Walk', { : Object.assign( function*(){ yield handler.call(this, ...arguments) }, {toString: function(){ return handler.toString() }}) }, + // XXX add options... __call__: function*(_, obj, path=[], type='root', seen=new Map()){ var that = this path = this.normalizePath ? @@ -197,6 +199,8 @@ object.Constructor('Walk', { yield* items .iter() .map(function*([key, value]){ + // XXX add relative path support... + // ...maybe [path, key] instead of path.concat(key) ??? yield* that(value, path.concat(key), type, seen) }) }) // handle STOP... } catch(err){