Comparing version 1.1.0 to 1.1.1
@@ -644,3 +644,7 @@ /** | ||
if (d[0] !== DIFF_EQUAL) { | ||
if (d == null) { | ||
// Text was deleted from end of original string, | ||
// cursor is now out of bounds in new string | ||
return diffs; | ||
} else if (d[0] !== DIFF_EQUAL) { | ||
// A modification happened at the cursor location. | ||
@@ -647,0 +651,0 @@ // This is the expected outcome, so we can return the original diff. |
{ | ||
"name": "fast-diff", | ||
"version": "1.1.0", | ||
"version": "1.1.1", | ||
"description": "Fast Javascript text diff", | ||
@@ -5,0 +5,0 @@ "author": "Jason Chen <jhchen7@gmail.com>", |
@@ -41,3 +41,3 @@ var _ = require('lodash'); | ||
for(var i = 0; i < ITERATIONS; ++i) { | ||
var cursor_pos = Math.floor(random() * strings[i].length); | ||
var cursor_pos = Math.floor(random() * strings[i].length + 1); | ||
var diffs = diff(strings[i], strings[i+1], cursor_pos); | ||
@@ -44,0 +44,0 @@ var patch = googlediff.patch_make(strings[i], strings[i+1], diffs); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
27677
698