From 61503e99437ee92afd6454574a81910f6796c733 Mon Sep 17 00:00:00 2001 From: "Alex A. Naanou" Date: Mon, 5 Jul 2021 01:13:20 +0300 Subject: [PATCH] tweaking... Signed-off-by: Alex A. Naanou --- diff2.js | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/diff2.js b/diff2.js index 2a86218..de2ab57 100644 --- a/diff2.js +++ b/diff2.js @@ -241,7 +241,10 @@ Walk({ obj // objects... : typeof(obj) == 'object' ? - {type: obj.constructor.name} + { + type: obj.constructor.name, + source: obj, + } // primitives... : obj, ] }, @@ -310,7 +313,10 @@ Object.assign( yield* !this.noText && typeof(obj) == 'string' && obj.includes('\n') ? - [ [path, {type: 'text'}] ] + [ [path, { + type: 'text', + source: obj, + }] ] : objectWalker.handler.call(this, ...arguments) }, listers: Object.assign( {text: function(obj){ @@ -839,6 +845,7 @@ console.log([ ...objectWalker(o) .chain( serializePaths, + stripAttr('source'), )]) @@ -889,7 +896,10 @@ console.log([ a multiline text`) - .chain(serializePaths) ]) + .chain( + serializePaths, + stripAttr('source'), + ) ]) console.log('---') @@ -900,7 +910,10 @@ console.log([ a multiline text`) - .chain(serializePaths) ]) + .chain( + serializePaths, + stripAttr('source'), + ) ]) console.log('---')