Skip to content

Commit f4205e5

Browse files
committed
deps: diff@5.1.0
1 parent 8f7abbe commit f4205e5

File tree

11 files changed

+137
-25
lines changed

11 files changed

+137
-25
lines changed

DEPENDENCIES.md

-2
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,6 @@ graph LR;
106106
npm-->npm-audit-report;
107107
npm-->npm-install-checks;
108108
npm-->npm-package-arg;
109-
npm-->npm-packlist;
110109
npm-->npm-profile;
111110
npm-->npm-registry-fetch;
112111
npm-->npm-user-validate;
@@ -511,7 +510,6 @@ graph LR;
511510
npm-->npm-audit-report;
512511
npm-->npm-install-checks;
513512
npm-->npm-package-arg;
514-
npm-->npm-packlist;
515513
npm-->npm-pick-manifest;
516514
npm-->npm-profile;
517515
npm-->npm-registry-fetch;

node_modules/diff/dist/diff.js

+49-4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,40 @@
1+
/*!
2+
3+
diff v5.1.0
4+
5+
Software License Agreement (BSD License)
6+
7+
Copyright (c) 2009-2015, Kevin Decker <kpdecker@gmail.com>
8+
9+
All rights reserved.
10+
11+
Redistribution and use of this software in source and binary forms, with or without modification,
12+
are permitted provided that the following conditions are met:
13+
14+
* Redistributions of source code must retain the above
15+
copyright notice, this list of conditions and the
16+
following disclaimer.
17+
18+
* Redistributions in binary form must reproduce the above
19+
copyright notice, this list of conditions and the
20+
following disclaimer in the documentation and/or other
21+
materials provided with the distribution.
22+
23+
* Neither the name of Kevin Decker nor the names of its
24+
contributors may be used to endorse or promote products
25+
derived from this software without specific prior
26+
written permission.
27+
28+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
29+
IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
30+
FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
31+
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
32+
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
33+
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
34+
IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
35+
OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
36+
@license
37+
*/
138
(function (global, factory) {
239
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
340
typeof define === 'function' && define.amd ? define(['exports'], factory) :
@@ -38,6 +75,11 @@
3875
oldLen = oldString.length;
3976
var editLength = 1;
4077
var maxEditLength = newLen + oldLen;
78+
79+
if (options.maxEditLength) {
80+
maxEditLength = Math.min(maxEditLength, options.maxEditLength);
81+
}
82+
4183
var bestPath = [{
4284
newPos: -1,
4385
components: []
@@ -102,15 +144,13 @@
102144
editLength++;
103145
} // Performs the length of edit iteration. Is a bit fugly as this has to support the
104146
// sync and async mode which is never fun. Loops over execEditLength until a value
105-
// is produced.
147+
// is produced, or until the edit length exceeds options.maxEditLength (if given),
148+
// in which case it will return undefined.
106149

107150

108151
if (callback) {
109152
(function exec() {
110153
setTimeout(function () {
111-
// This should not happen, but we want to be safe.
112-
113-
/* istanbul ignore next */
114154
if (editLength > maxEditLength) {
115155
return callback();
116156
}
@@ -928,6 +968,11 @@
928968
}
929969

930970
var diff = diffLines(oldStr, newStr, options);
971+
972+
if (!diff) {
973+
return;
974+
}
975+
931976
diff.push({
932977
value: '',
933978
lines: []

node_modules/diff/dist/diff.min.js

+38
Large diffs are not rendered by default.

node_modules/diff/lib/diff/base.js

+8-5
Large diffs are not rendered by default.

node_modules/diff/lib/index.es6.js

+12-4
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,11 @@ Diff.prototype = {
3232
oldLen = oldString.length;
3333
var editLength = 1;
3434
var maxEditLength = newLen + oldLen;
35+
36+
if (options.maxEditLength) {
37+
maxEditLength = Math.min(maxEditLength, options.maxEditLength);
38+
}
39+
3540
var bestPath = [{
3641
newPos: -1,
3742
components: []
@@ -96,15 +101,13 @@ Diff.prototype = {
96101
editLength++;
97102
} // Performs the length of edit iteration. Is a bit fugly as this has to support the
98103
// sync and async mode which is never fun. Loops over execEditLength until a value
99-
// is produced.
104+
// is produced, or until the edit length exceeds options.maxEditLength (if given),
105+
// in which case it will return undefined.
100106

101107

102108
if (callback) {
103109
(function exec() {
104110
setTimeout(function () {
105-
// This should not happen, but we want to be safe.
106-
107-
/* istanbul ignore next */
108111
if (editLength > maxEditLength) {
109112
return callback();
110113
}
@@ -922,6 +925,11 @@ function structuredPatch(oldFileName, newFileName, oldStr, newStr, oldHeader, ne
922925
}
923926

924927
var diff = diffLines(oldStr, newStr, options);
928+
929+
if (!diff) {
930+
return;
931+
}
932+
925933
diff.push({
926934
value: '',
927935
lines: []

node_modules/diff/lib/index.mjs

+12-4
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,11 @@ Diff.prototype = {
3232
oldLen = oldString.length;
3333
var editLength = 1;
3434
var maxEditLength = newLen + oldLen;
35+
36+
if (options.maxEditLength) {
37+
maxEditLength = Math.min(maxEditLength, options.maxEditLength);
38+
}
39+
3540
var bestPath = [{
3641
newPos: -1,
3742
components: []
@@ -96,15 +101,13 @@ Diff.prototype = {
96101
editLength++;
97102
} // Performs the length of edit iteration. Is a bit fugly as this has to support the
98103
// sync and async mode which is never fun. Loops over execEditLength until a value
99-
// is produced.
104+
// is produced, or until the edit length exceeds options.maxEditLength (if given),
105+
// in which case it will return undefined.
100106

101107

102108
if (callback) {
103109
(function exec() {
104110
setTimeout(function () {
105-
// This should not happen, but we want to be safe.
106-
107-
/* istanbul ignore next */
108111
if (editLength > maxEditLength) {
109112
return callback();
110113
}
@@ -922,6 +925,11 @@ function structuredPatch(oldFileName, newFileName, oldStr, newStr, oldHeader, ne
922925
}
923926

924927
var diff = diffLines(oldStr, newStr, options);
928+
929+
if (!diff) {
930+
return;
931+
}
932+
925933
diff.push({
926934
value: '',
927935
lines: []

0 commit comments

Comments
 (0)