Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Make oldHeader and newHeader optional

    createPatch(fileName, oldStr, newStr, oldHeader, newHeader)

The last two arguments should be optional.
  • Loading branch information...
commit 645e868230993d43778bf528be2fb76d2bcc6303 1 parent 01da667
Nikita Vasilyev NV authored
Showing with 2 additions and 2 deletions.
  1. +2 −2 diff.js
4 diff.js
View
@@ -187,8 +187,8 @@ var JsDiff = (function() {
ret.push("Index: " + fileName);
ret.push("===================================================================");
- ret.push("--- " + fileName + "\t" + oldHeader);
- ret.push("+++ " + fileName + "\t" + newHeader);
+ ret.push("--- " + fileName + (typeof oldHeader === "undefined" ? "" : "\t" + oldHeader));
+ ret.push("+++ " + fileName + (typeof newHeader === "undefined" ? "" : "\t" + newHeader));
var diff = LineDiff.diff(oldStr, newStr);
diff.push({value: "", lines: []}); // Append an empty value to make cleanup easier
Please sign in to comment.
Something went wrong with that request. Please try again.