Comparing version 1.0.2 to 1.0.3
@@ -281,2 +281,11 @@ /* See license.txt for terms of usage */ | ||
return ret.join(""); | ||
}, | ||
convertChangesToDMP: function(changes){ | ||
var ret = [], change; | ||
for ( var i = 0; i < changes.length; i++) { | ||
change = changes[i]; | ||
ret.push([(change.added ? 1 : change.removed ? -1 : 0), change.value]); | ||
} | ||
return ret; | ||
} | ||
@@ -283,0 +292,0 @@ }; |
{ | ||
"name": "diff", | ||
"version": "1.0.2", | ||
"version": "1.0.3", | ||
"description": "A javascript text diff implementation.", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -617,1 +617,10 @@ const VERBOSE = false; | ||
}; | ||
exports['convertToDMP'] = function() { | ||
diffResult = diff.diffWords("New Value ", "New ValueMoreData "); | ||
assert.deepEqual( | ||
[[0,'New '],[1,'ValueMoreData'],[-1,'Value'],[0,' ']], | ||
diff.convertChangesToDMP(diffResult), | ||
"DMP conversion of diffResult"); | ||
}; |
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
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
71215
934
0