Skip to content

Commit b3a842f

Browse files
committed
change parameter name.
1 parent 98655bb commit b3a842f

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ npm install patchjs-diff --save-dev
88

99
## API
1010

11-
calcDiffData (oldString, newString)
11+
calcDiffData (src, dest)
1212

1313
## Algorithm
1414

src/index.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,20 @@ import crypto from 'crypto';
22

33
const CHUNK_SIZE = 20;
44

5-
export default function calcDiffData (localFileContent, fileContent) {
5+
export default function calcDiffData (srcFileContent, destFileContent) {
66
let result = {};
77
result.m = true;
88
result.l = CHUNK_SIZE;
99

1010
let diffDataArray = [];
11-
if (md5(localFileContent) === md5(fileContent)) {
11+
if (md5(srcFileContent) === md5(destFileContent)) {
1212
result.m = false;
1313
result.c = diffDataArray;
1414
return result;
1515
}
1616

17-
const md5Map = checksum(localFileContent);
18-
const diffArray = roll(fileContent, md5Map);
17+
const md5Map = checksum(srcFileContent);
18+
const diffArray = roll(destFileContent, md5Map);
1919
let arrayData = '';
2020
let lastItem = null;
2121
let matchedCount = 0;

0 commit comments

Comments
 (0)