File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff 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 ( ) ,
You can’t perform that action at this time.
0 commit comments