Skip to content

Commit 75fe855

Browse files
committed
Fixing tests
1 parent 3be1c90 commit 75fe855

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

src/compute-lines.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,12 @@ const constructLines = (value: string): string[] => {
8686
* @param newValue New word in the line.
8787
* @param compareMethod JsDiff text diff method from https://github.com/kpdecker/jsdiff/tree/v4.0.1#api
8888
*/
89-
const computeDiff = (oldValue: string, newValue: string, compareMethod: string): ComputedDiffInformation => {
90-
const diffArray: Array<JsDiffChangeObject> = jsDiff[compareMethod](oldValue, newValue);
89+
const computeDiff = (
90+
oldValue: string,
91+
newValue: string,
92+
compareMethod: string = DiffMethod.CHARS,
93+
): ComputedDiffInformation => {
94+
const diffArray: JsDiffChangeObject[] = jsDiff[compareMethod](oldValue, newValue);
9195
const computedDiff: ComputedDiffInformation = {
9296
left: [],
9397
right: [],
@@ -133,7 +137,7 @@ const computeLineInformation = (
133137
oldString: string,
134138
newString: string,
135139
disableWordDiff: boolean = false,
136-
compareMethod: string,
140+
compareMethod: string = DiffMethod.CHARS,
137141
): ComputedLineInformation => {
138142
const diffArray = diff.diffLines(
139143
oldString.trimRight(),

0 commit comments

Comments
 (0)