big-object-diff
Advanced tools
Comparing version 0.6.0 to 0.7.0
{ | ||
"name": "big-object-diff", | ||
"version": "0.6.0", | ||
"version": "0.7.0", | ||
"engines": { | ||
@@ -5,0 +5,0 @@ "node": ">=0.10" |
@@ -38,2 +38,4 @@ # Big Object Diff | ||
* 0.7.0 long strings are truncated | ||
* 0.6.0 renderDiff() collapses objects as much as possible | ||
@@ -47,3 +49,3 @@ | ||
Copyright (c) 2012-2014 James Shore | ||
Copyright (c) 2014 James Shore | ||
@@ -50,0 +52,0 @@ Permission is hereby granted, free of charge, to any person obtaining a copy |
@@ -270,2 +270,6 @@ // Copyright (c) 2014 Titanium I.T. LLC. All rights reserved. For license, see "README" or "LICENSE" file. | ||
expect(diff.render("\t\tfoo\n\n")).to.equal('"\\t\\tfoo\\n\\n"'); | ||
expect(diff.render('1234567890123456789012345678901234567890123456789012345678901234567890')) | ||
.to.equal('"12345678901234567890123456789012345678901234567890123456789"...'); | ||
expect(diff.render('12345678901234567890123456789012345678901234567890123456789')) | ||
.to.equal('"12345678901234567890123456789012345678901234567890123456789"'); | ||
}); | ||
@@ -272,0 +276,0 @@ |
@@ -108,3 +108,7 @@ // Copyright (c) 2014 Titanium I.T. LLC. All rights reserved. For license, see "README" or "LICENSE" file. | ||
if (obj === null) return "null"; | ||
if (typeof obj === "string") return JSON.stringify(obj); | ||
if (typeof obj === "string") { | ||
var str = JSON.stringify(obj); | ||
if (str.length > 61) str = str.substr(0, 60) + '"...'; // >61, not >60, because of trailing quote | ||
return str; | ||
} | ||
if (isArray(obj)) { | ||
@@ -111,0 +115,0 @@ if (obj.length === 0) return "[]"; |
23418
656
68