Skip to content

Commit 64eb920

Browse files
authored
Merge pull request #153 from Kiougar/patch-1
feat(structuredPatch): Pass options to diffLines
2 parents 2f92dae + 663cd3f commit 64eb920

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

Diff for: src/patch/create.js

+5-2
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,13 @@ import {diffLines} from '../diff/line';
22

33
export function structuredPatch(oldFileName, newFileName, oldStr, newStr, oldHeader, newHeader, options) {
44
if (!options) {
5-
options = { context: 4 };
5+
options = {};
6+
}
7+
if (typeof options.context === 'undefined') {
8+
options.context = 4;
69
}
710

8-
const diff = diffLines(oldStr, newStr);
11+
const diff = diffLines(oldStr, newStr, options);
912
diff.push({value: '', lines: []}); // Append an empty value to make cleanup easier
1013

1114
function contextLines(lines) {

0 commit comments

Comments
 (0)