File tree 2 files changed +5
-5
lines changed
2 files changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -8,7 +8,7 @@ npm install patchjs-diff --save-dev
8
8
9
9
## API
10
10
11
- calcDiffData (oldString, newString )
11
+ calcDiffData (src, dest )
12
12
13
13
## Algorithm
14
14
Original file line number Diff line number Diff line change @@ -2,20 +2,20 @@ import crypto from 'crypto';
2
2
3
3
const CHUNK_SIZE = 20 ;
4
4
5
- export default function calcDiffData ( localFileContent , fileContent ) {
5
+ export default function calcDiffData ( srcFileContent , destFileContent ) {
6
6
let result = { } ;
7
7
result . m = true ;
8
8
result . l = CHUNK_SIZE ;
9
9
10
10
let diffDataArray = [ ] ;
11
- if ( md5 ( localFileContent ) === md5 ( fileContent ) ) {
11
+ if ( md5 ( srcFileContent ) === md5 ( destFileContent ) ) {
12
12
result . m = false ;
13
13
result . c = diffDataArray ;
14
14
return result ;
15
15
}
16
16
17
- const md5Map = checksum ( localFileContent ) ;
18
- const diffArray = roll ( fileContent , md5Map ) ;
17
+ const md5Map = checksum ( srcFileContent ) ;
18
+ const diffArray = roll ( destFileContent , md5Map ) ;
19
19
let arrayData = '' ;
20
20
let lastItem = null ;
21
21
let matchedCount = 0 ;
You can’t perform that action at this time.
0 commit comments