Skip to content

Commit 2a9df41

Browse files
authored
feat(structuredPatch): Handle default context option
1 parent 53ffcbd commit 2a9df41

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/patch/create.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,10 @@ 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 (!options.context) {
8+
options.context = 4;
69
}
710

811
const diff = diffLines(oldStr, newStr, options);

0 commit comments

Comments
 (0)