Skip to content
This repository
Browse code

fix for deleted object stringification

  • Loading branch information...
commit 1fbcb8bee6a5b1311a83c5e4a870d8190bb8850d 1 parent a33d5f0
James Halliday authored
2  example/cmp_object.js
... ...
@@ -1,6 +1,6 @@
1 1
 var difflet = require('../');
2 2
 var s = difflet({ indent : 2, comment : true }).compare(
3  
-    { z : 6, a : 'abcdefgh', b : [ 31, 'xxt' ] },
  3
+    { z : [6,7], a : 'abcdefgh', b : [ 31, 'xxt' ] },
4 4
     { x : 5, a : 'abdcefg', b : [ 51, 'xxs' ] }
5 5
 );
6 6
 process.stdout.write(s);
4  index.js
@@ -273,7 +273,9 @@ function difflet (opts, prev, next) {
273 273
                         
274 274
                         plainStringify(key);
275 275
                         write(indent ? ' : ' : ':');
276  
-                        plainStringify(prevNode[key]);
  276
+                        traverse(prevNode[key]).forEach(function (x) {
  277
+                            plainStringify.call(this, x, { indent : 0 });
  278
+                        });
277 279
                         
278 280
                         var last = ix === deleted.length - 1;
279 281
                         if (insertable && !last) {

0 notes on commit 1fbcb8b

Please sign in to comment.
Something went wrong with that request. Please try again.