Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

fix for deleted object stringification

  • Loading branch information...
commit 1fbcb8bee6a5b1311a83c5e4a870d8190bb8850d 1 parent a33d5f0
@substack authored
Showing with 4 additions and 2 deletions.
  1. +1 −1  example/cmp_object.js
  2. +3 −1 index.js
View
2  example/cmp_object.js
@@ -1,6 +1,6 @@
var difflet = require('../');
var s = difflet({ indent : 2, comment : true }).compare(
- { z : 6, a : 'abcdefgh', b : [ 31, 'xxt' ] },
+ { z : [6,7], a : 'abcdefgh', b : [ 31, 'xxt' ] },
{ x : 5, a : 'abdcefg', b : [ 51, 'xxs' ] }
);
process.stdout.write(s);
View
4 index.js
@@ -273,7 +273,9 @@ function difflet (opts, prev, next) {
plainStringify(key);
write(indent ? ' : ' : ':');
- plainStringify(prevNode[key]);
+ traverse(prevNode[key]).forEach(function (x) {
+ plainStringify.call(this, x, { indent : 0 });
+ });
var last = ix === deleted.length - 1;
if (insertable && !last) {
Please sign in to comment.
Something went wrong with that request. Please try again.