Skip to content

Commit d00bf96

Browse files
committed
1 parent 7a74819 commit d00bf96

8 files changed

Lines changed: 42 additions & 41 deletions

File tree

node_modules/diff/dist/diff.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -674,10 +674,10 @@
674674
} // Diff index
675675

676676

677-
var header = /^(?:Index:|diff(?: -r \w+)+)\s+(.+?)\s*$/.exec(line);
677+
var headerMatch = /^(?:Index:|diff(?: -r \w+)+)\s+/.exec(line);
678678

679-
if (header) {
680-
index.index = header[1];
679+
if (headerMatch) {
680+
index.index = line.substring(headerMatch[0].length).trim();
681681
}
682682

683683
i++;
@@ -709,14 +709,14 @@
709709

710710

711711
function parseFileHeader(index) {
712-
var fileHeader = /^(---|\+\+\+)\s+(.*)$/.exec(diffstr[i]);
712+
var fileHeaderMatch = /^(---|\+\+\+)\s+/.exec(diffstr[i]);
713713

714-
if (fileHeader) {
715-
var keyPrefix = fileHeader[1] === '---' ? 'old' : 'new';
716-
var data = fileHeader[2].split('\t', 2);
714+
if (fileHeaderMatch) {
715+
var keyPrefix = fileHeaderMatch[1] === '---' ? 'old' : 'new';
716+
var data = diffstr[i].substring(3).trim().split('\t', 2);
717717
var fileName = data[0].replace(/\\\\/g, '\\');
718718

719-
if (/^".*"$/.test(fileName)) {
719+
if (fileName.startsWith('"') && fileName.endsWith('"')) {
720720
fileName = fileName.substr(1, fileName.length - 2);
721721
}
722722

node_modules/diff/dist/diff.min.js

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

node_modules/diff/lib/index.es6.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -668,10 +668,10 @@ function parsePatch(uniDiff) {
668668
} // Diff index
669669

670670

671-
var header = /^(?:Index:|diff(?: -r \w+)+)\s+(.+?)\s*$/.exec(line);
671+
var headerMatch = /^(?:Index:|diff(?: -r \w+)+)\s+/.exec(line);
672672

673-
if (header) {
674-
index.index = header[1];
673+
if (headerMatch) {
674+
index.index = line.substring(headerMatch[0].length).trim();
675675
}
676676

677677
i++;
@@ -703,14 +703,14 @@ function parsePatch(uniDiff) {
703703

704704

705705
function parseFileHeader(index) {
706-
var fileHeader = /^(---|\+\+\+)\s+(.*)$/.exec(diffstr[i]);
706+
var fileHeaderMatch = /^(---|\+\+\+)\s+/.exec(diffstr[i]);
707707

708-
if (fileHeader) {
709-
var keyPrefix = fileHeader[1] === '---' ? 'old' : 'new';
710-
var data = fileHeader[2].split('\t', 2);
708+
if (fileHeaderMatch) {
709+
var keyPrefix = fileHeaderMatch[1] === '---' ? 'old' : 'new';
710+
var data = diffstr[i].substring(3).trim().split('\t', 2);
711711
var fileName = data[0].replace(/\\\\/g, '\\');
712712

713-
if (/^".*"$/.test(fileName)) {
713+
if (fileName.startsWith('"') && fileName.endsWith('"')) {
714714
fileName = fileName.substr(1, fileName.length - 2);
715715
}
716716

node_modules/diff/lib/index.mjs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -668,10 +668,10 @@ function parsePatch(uniDiff) {
668668
} // Diff index
669669

670670

671-
var header = /^(?:Index:|diff(?: -r \w+)+)\s+(.+?)\s*$/.exec(line);
671+
var headerMatch = /^(?:Index:|diff(?: -r \w+)+)\s+/.exec(line);
672672

673-
if (header) {
674-
index.index = header[1];
673+
if (headerMatch) {
674+
index.index = line.substring(headerMatch[0].length).trim();
675675
}
676676

677677
i++;
@@ -703,14 +703,14 @@ function parsePatch(uniDiff) {
703703

704704

705705
function parseFileHeader(index) {
706-
var fileHeader = /^(---|\+\+\+)\s+(.*)$/.exec(diffstr[i]);
706+
var fileHeaderMatch = /^(---|\+\+\+)\s+/.exec(diffstr[i]);
707707

708-
if (fileHeader) {
709-
var keyPrefix = fileHeader[1] === '---' ? 'old' : 'new';
710-
var data = fileHeader[2].split('\t', 2);
708+
if (fileHeaderMatch) {
709+
var keyPrefix = fileHeaderMatch[1] === '---' ? 'old' : 'new';
710+
var data = diffstr[i].substring(3).trim().split('\t', 2);
711711
var fileName = data[0].replace(/\\\\/g, '\\');
712712

713-
if (/^".*"$/.test(fileName)) {
713+
if (fileName.startsWith('"') && fileName.endsWith('"')) {
714714
fileName = fileName.substr(1, fileName.length - 2);
715715
}
716716

node_modules/diff/lib/patch/parse.js

Lines changed: 9 additions & 9 deletions
Large diffs are not rendered by default.

node_modules/diff/package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "diff",
3-
"version": "5.2.0",
3+
"version": "5.2.2",
44
"description": "A JavaScript text diff implementation.",
55
"keywords": [
66
"diff",
@@ -85,5 +85,6 @@
8585
"webpack": "^4.28.3",
8686
"webpack-dev-server": "^3.1.14"
8787
},
88-
"optionalDependencies": {}
88+
"optionalDependencies": {},
89+
"packageManager": "[email protected]+sha1.ac34549e6aa8e7ead463a7407e1c7390f61a6610"
8990
}

package-lock.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@
171171
"ajv-formats": "^2.1.1",
172172
"ajv-formats-draft2019": "^1.6.1",
173173
"cli-table3": "^0.6.4",
174-
"diff": "^5.2.0",
174+
"diff": "^5.2.2",
175175
"nock": "^13.4.0",
176176
"npm-packlist": "^9.0.0",
177177
"remark": "^14.0.2",
@@ -5468,9 +5468,9 @@
54685468
}
54695469
},
54705470
"node_modules/diff": {
5471-
"version": "5.2.0",
5472-
"resolved": "https://registry.npmjs.org/diff/-/diff-5.2.0.tgz",
5473-
"integrity": "sha512-uIFDxqpRZGZ6ThOk84hEfqWoHx2devRFvpTZcTHur85vImfaxUbTW9Ryh4CpCuDnToOP1CEtXKIgytHBPVff5A==",
5471+
"version": "5.2.2",
5472+
"resolved": "https://registry.npmjs.org/diff/-/diff-5.2.2.tgz",
5473+
"integrity": "sha512-vtcDfH3TOjP8UekytvnHH1o1P4FcUdt4eQ1Y+Abap1tk/OB2MWQvcwS2ClCd1zuIhc3JKOx6p3kod8Vfys3E+A==",
54745474
"license": "BSD-3-Clause",
54755475
"engines": {
54765476
"node": ">=0.3.1"

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@
202202
"ajv-formats": "^2.1.1",
203203
"ajv-formats-draft2019": "^1.6.1",
204204
"cli-table3": "^0.6.4",
205-
"diff": "^5.2.0",
205+
"diff": "^5.2.2",
206206
"nock": "^13.4.0",
207207
"npm-packlist": "^9.0.0",
208208
"remark": "^14.0.2",

0 commit comments

Comments
 (0)