cross-spawn-cb 2.3.5 → 2.3.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/assets/cross-spawn.cjs +88 -90
- package/package.json +2 -2
package/assets/cross-spawn.cjs
CHANGED
|
@@ -3,22 +3,22 @@
|
|
|
3
3
|
/* COMPATIBILITY POLYFILLS */
|
|
4
4
|
|
|
5
5
|
function objectAssign(target) {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
}
|
|
6
|
+
// biome-ignore lint/style/noArguments: <explanation>
|
|
7
|
+
var objects = Array.prototype.slice.call(arguments, 1);
|
|
8
|
+
while (objects.length) {
|
|
9
|
+
var object = objects.pop();
|
|
10
|
+
for (var key in object) {
|
|
11
|
+
target[key] = object[key];
|
|
13
12
|
}
|
|
14
|
-
|
|
13
|
+
}
|
|
14
|
+
return target;
|
|
15
15
|
}
|
|
16
16
|
|
|
17
17
|
function findKey(obj, fn) {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
18
|
+
for (var key in obj) {
|
|
19
|
+
if (fn(key)) return key;
|
|
20
|
+
}
|
|
21
|
+
return null
|
|
22
22
|
}
|
|
23
23
|
|
|
24
24
|
var pathDelimiter = process.platform === 'win32' ? ';' : ':';
|
|
@@ -51,7 +51,7 @@ function requireSrc() {
|
|
|
51
51
|
*/ src = function src(fn) {
|
|
52
52
|
try {
|
|
53
53
|
return fn();
|
|
54
|
-
} catch (e) {
|
|
54
|
+
} catch (e) {}
|
|
55
55
|
};
|
|
56
56
|
return src;
|
|
57
57
|
}
|
|
@@ -73,7 +73,7 @@ function requireWindows() {
|
|
|
73
73
|
if (pathext.indexOf('') !== -1) {
|
|
74
74
|
return true;
|
|
75
75
|
}
|
|
76
|
-
for
|
|
76
|
+
for(var i = 0; i < pathext.length; i++){
|
|
77
77
|
var p = pathext[i].toLowerCase();
|
|
78
78
|
if (p && path.substr(-p.length).toLowerCase() === p) {
|
|
79
79
|
return true;
|
|
@@ -88,7 +88,7 @@ function requireWindows() {
|
|
|
88
88
|
return checkPathExt(path, options);
|
|
89
89
|
}
|
|
90
90
|
function isexe(path, options, cb) {
|
|
91
|
-
fs.stat(path, function
|
|
91
|
+
fs.stat(path, function(er, stat) {
|
|
92
92
|
cb(er, er ? false : checkStat(stat, path, options));
|
|
93
93
|
});
|
|
94
94
|
}
|
|
@@ -107,7 +107,7 @@ function requireMode() {
|
|
|
107
107
|
isexe.sync = sync;
|
|
108
108
|
var fs = require$$0;
|
|
109
109
|
function isexe(path, options, cb) {
|
|
110
|
-
fs.stat(path, function
|
|
110
|
+
fs.stat(path, function(er, stat) {
|
|
111
111
|
cb(er, er ? false : checkStat(stat, options));
|
|
112
112
|
});
|
|
113
113
|
}
|
|
@@ -155,8 +155,8 @@ function requireIsexe() {
|
|
|
155
155
|
if (typeof Promise !== 'function') {
|
|
156
156
|
throw new TypeError('callback not provided');
|
|
157
157
|
}
|
|
158
|
-
return new Promise(function
|
|
159
|
-
isexe(path, options || {}, function
|
|
158
|
+
return new Promise(function(resolve, reject) {
|
|
159
|
+
isexe(path, options || {}, function(er, is) {
|
|
160
160
|
if (er) {
|
|
161
161
|
reject(er);
|
|
162
162
|
} else {
|
|
@@ -165,7 +165,7 @@ function requireIsexe() {
|
|
|
165
165
|
});
|
|
166
166
|
});
|
|
167
167
|
}
|
|
168
|
-
core(path, options || {}, function
|
|
168
|
+
core(path, options || {}, function(er, is) {
|
|
169
169
|
// ignore EACCES because that just means we aren't allowed to run it
|
|
170
170
|
if (er) {
|
|
171
171
|
if (er.code === 'EACCES' || options && options.ignoreErrors) {
|
|
@@ -260,7 +260,7 @@ function requireWhich() {
|
|
|
260
260
|
var ext = pathExt[ii];
|
|
261
261
|
isexe(p + ext, {
|
|
262
262
|
pathExt: pathExtExe
|
|
263
|
-
}, function
|
|
263
|
+
}, function(er, is) {
|
|
264
264
|
if (!er && is) {
|
|
265
265
|
if (opt.all) found.push(p + ext);
|
|
266
266
|
else return cb(null, p + ext);
|
|
@@ -277,14 +277,14 @@ function requireWhich() {
|
|
|
277
277
|
var pathExt = info.ext;
|
|
278
278
|
var pathExtExe = info.extExe;
|
|
279
279
|
var found = [];
|
|
280
|
-
for
|
|
280
|
+
for(var i = 0, l = pathEnv.length; i < l; i++){
|
|
281
281
|
var pathPart = pathEnv[i];
|
|
282
282
|
if (pathPart.charAt(0) === '"' && pathPart.slice(-1) === '"') pathPart = pathPart.slice(1, -1);
|
|
283
283
|
var p = path.join(pathPart, cmd);
|
|
284
284
|
if (!pathPart && /^\.[\\\/]/.test(cmd)) {
|
|
285
285
|
p = cmd.slice(0, 2) + p;
|
|
286
286
|
}
|
|
287
|
-
for
|
|
287
|
+
for(var j = 0, ll = pathExt.length; j < ll; j++){
|
|
288
288
|
var cur = p + pathExt[j];
|
|
289
289
|
var is;
|
|
290
290
|
try {
|
|
@@ -295,7 +295,7 @@ function requireWhich() {
|
|
|
295
295
|
if (opt.all) found.push(cur);
|
|
296
296
|
else return cur;
|
|
297
297
|
}
|
|
298
|
-
} catch (ex) {
|
|
298
|
+
} catch (ex) {}
|
|
299
299
|
}
|
|
300
300
|
}
|
|
301
301
|
if (opt.all && found.length) return found;
|
|
@@ -310,14 +310,14 @@ var hasRequiredPathKey;
|
|
|
310
310
|
function requirePathKey() {
|
|
311
311
|
if (hasRequiredPathKey) return pathKey;
|
|
312
312
|
hasRequiredPathKey = 1;
|
|
313
|
-
pathKey = function
|
|
313
|
+
pathKey = function(opts) {
|
|
314
314
|
opts = opts || {};
|
|
315
315
|
var env = opts.env || process.env;
|
|
316
316
|
var platform = opts.platform || process.platform;
|
|
317
317
|
if (platform !== 'win32') {
|
|
318
318
|
return 'PATH';
|
|
319
319
|
}
|
|
320
|
-
return findKey(env, function
|
|
320
|
+
return findKey(env, function(x) {
|
|
321
321
|
return x.toUpperCase() === 'PATH';
|
|
322
322
|
}) || 'Path';
|
|
323
323
|
};
|
|
@@ -341,8 +341,7 @@ function requireResolveCommand() {
|
|
|
341
341
|
try {
|
|
342
342
|
process.chdir(parsed.options.cwd);
|
|
343
343
|
} catch (err) {
|
|
344
|
-
|
|
345
|
-
}
|
|
344
|
+
/* Empty */ }
|
|
346
345
|
}
|
|
347
346
|
var resolved;
|
|
348
347
|
try {
|
|
@@ -351,8 +350,7 @@ function requireResolveCommand() {
|
|
|
351
350
|
pathExt: withoutPathExt ? pathDelimiter : undefined
|
|
352
351
|
});
|
|
353
352
|
} catch (e) {
|
|
354
|
-
|
|
355
|
-
} finally {
|
|
353
|
+
/* Empty */ } finally{
|
|
356
354
|
process.chdir(cwd);
|
|
357
355
|
}
|
|
358
356
|
// If we successfully resolved, ensure that an absolute path is returned
|
|
@@ -461,7 +459,7 @@ function requireReadShebang() {
|
|
|
461
459
|
fd = fs.openSync(command, 'r');
|
|
462
460
|
fs.readSync(fd, buffer, 0, size, 0);
|
|
463
461
|
fs.closeSync(fd);
|
|
464
|
-
} catch (e) {
|
|
462
|
+
} catch (e) {}
|
|
465
463
|
// Attempt to extract shebang (null is returned if not a shebang)
|
|
466
464
|
return shebangCommand(buffer.toString());
|
|
467
465
|
}
|
|
@@ -488,7 +486,7 @@ var hasRequiredSemver;
|
|
|
488
486
|
function requireSemver() {
|
|
489
487
|
if (hasRequiredSemver) return semver.exports;
|
|
490
488
|
hasRequiredSemver = 1;
|
|
491
|
-
(function
|
|
489
|
+
(function(module, exports) {
|
|
492
490
|
exports = module.exports = SemVer;
|
|
493
491
|
var debug;
|
|
494
492
|
/* istanbul ignore next */ if ((typeof process === "undefined" ? "undefined" : _type_of(process)) === 'object' && process.env && process.env.NODE_DEBUG && /\bsemver\b/i.test(process.env.NODE_DEBUG)) {
|
|
@@ -498,7 +496,7 @@ function requireSemver() {
|
|
|
498
496
|
console.log.apply(console, args);
|
|
499
497
|
};
|
|
500
498
|
} else {
|
|
501
|
-
debug = function debug() {
|
|
499
|
+
debug = function debug() {};
|
|
502
500
|
}
|
|
503
501
|
// Note: this is the semver.org version of the spec that it implements
|
|
504
502
|
// Not necessarily the package version of this code.
|
|
@@ -535,7 +533,7 @@ function requireSemver() {
|
|
|
535
533
|
]
|
|
536
534
|
];
|
|
537
535
|
function makeSafeRe(value) {
|
|
538
|
-
for
|
|
536
|
+
for(var i = 0; i < safeRegexReplacements.length; i++){
|
|
539
537
|
var token = safeRegexReplacements[i][0];
|
|
540
538
|
var max = safeRegexReplacements[i][1];
|
|
541
539
|
value = value.split(token + '*').join(token + '{0,' + max + '}').split(token + '+').join(token + '{1,' + max + '}');
|
|
@@ -672,7 +670,7 @@ function requireSemver() {
|
|
|
672
670
|
src[STAR] = '(<|>)?=?\\s*\\*';
|
|
673
671
|
// Compile to actual regexp objects.
|
|
674
672
|
// All are flag-free, unless they were created above with a flag.
|
|
675
|
-
for
|
|
673
|
+
for(var i = 0; i < R; i++){
|
|
676
674
|
debug(i, src[i]);
|
|
677
675
|
if (!re[i]) {
|
|
678
676
|
re[i] = new RegExp(src[i]);
|
|
@@ -770,7 +768,7 @@ function requireSemver() {
|
|
|
770
768
|
if (!m[4]) {
|
|
771
769
|
this.prerelease = [];
|
|
772
770
|
} else {
|
|
773
|
-
this.prerelease = m[4].split('.').map(function
|
|
771
|
+
this.prerelease = m[4].split('.').map(function(id) {
|
|
774
772
|
if (/^[0-9]+$/.test(id)) {
|
|
775
773
|
var num = +id;
|
|
776
774
|
if (num >= 0 && num < MAX_SAFE_INTEGER) {
|
|
@@ -783,30 +781,30 @@ function requireSemver() {
|
|
|
783
781
|
this.build = m[5] ? m[5].split('.') : [];
|
|
784
782
|
this.format();
|
|
785
783
|
}
|
|
786
|
-
SemVer.prototype.format = function
|
|
784
|
+
SemVer.prototype.format = function() {
|
|
787
785
|
this.version = this.major + '.' + this.minor + '.' + this.patch;
|
|
788
786
|
if (this.prerelease.length) {
|
|
789
787
|
this.version += '-' + this.prerelease.join('.');
|
|
790
788
|
}
|
|
791
789
|
return this.version;
|
|
792
790
|
};
|
|
793
|
-
SemVer.prototype.toString = function
|
|
791
|
+
SemVer.prototype.toString = function() {
|
|
794
792
|
return this.version;
|
|
795
793
|
};
|
|
796
|
-
SemVer.prototype.compare = function
|
|
794
|
+
SemVer.prototype.compare = function(other) {
|
|
797
795
|
debug('SemVer.compare', this.version, this.options, other);
|
|
798
796
|
if (!_instanceof(other, SemVer)) {
|
|
799
797
|
other = new SemVer(other, this.options);
|
|
800
798
|
}
|
|
801
799
|
return this.compareMain(other) || this.comparePre(other);
|
|
802
800
|
};
|
|
803
|
-
SemVer.prototype.compareMain = function
|
|
801
|
+
SemVer.prototype.compareMain = function(other) {
|
|
804
802
|
if (!_instanceof(other, SemVer)) {
|
|
805
803
|
other = new SemVer(other, this.options);
|
|
806
804
|
}
|
|
807
805
|
return compareIdentifiers(this.major, other.major) || compareIdentifiers(this.minor, other.minor) || compareIdentifiers(this.patch, other.patch);
|
|
808
806
|
};
|
|
809
|
-
SemVer.prototype.comparePre = function
|
|
807
|
+
SemVer.prototype.comparePre = function(other) {
|
|
810
808
|
if (!_instanceof(other, SemVer)) {
|
|
811
809
|
other = new SemVer(other, this.options);
|
|
812
810
|
}
|
|
@@ -834,12 +832,12 @@ function requireSemver() {
|
|
|
834
832
|
} else {
|
|
835
833
|
return compareIdentifiers(a, b);
|
|
836
834
|
}
|
|
837
|
-
}
|
|
835
|
+
}while (++i);
|
|
838
836
|
};
|
|
839
837
|
// preminor will bump the version up to the next minor release, and immediately
|
|
840
838
|
// down to pre-release. premajor and prepatch work the same way.
|
|
841
|
-
SemVer.prototype.inc = function
|
|
842
|
-
switch
|
|
839
|
+
SemVer.prototype.inc = function(release, identifier) {
|
|
840
|
+
switch(release){
|
|
843
841
|
case 'premajor':
|
|
844
842
|
this.prerelease.length = 0;
|
|
845
843
|
this.patch = 0;
|
|
@@ -911,7 +909,7 @@ function requireSemver() {
|
|
|
911
909
|
];
|
|
912
910
|
} else {
|
|
913
911
|
var i = this.prerelease.length;
|
|
914
|
-
while
|
|
912
|
+
while(--i >= 0){
|
|
915
913
|
if (typeof this.prerelease[i] === 'number') {
|
|
916
914
|
this.prerelease[i]++;
|
|
917
915
|
i = -2;
|
|
@@ -971,7 +969,7 @@ function requireSemver() {
|
|
|
971
969
|
prefix = 'pre';
|
|
972
970
|
var defaultResult = 'prerelease';
|
|
973
971
|
}
|
|
974
|
-
for
|
|
972
|
+
for(var key in v1){
|
|
975
973
|
if (key === 'major' || key === 'minor' || key === 'patch') {
|
|
976
974
|
if (v1[key] !== v2[key]) {
|
|
977
975
|
return prefix + key;
|
|
@@ -979,7 +977,7 @@ function requireSemver() {
|
|
|
979
977
|
}
|
|
980
978
|
}
|
|
981
979
|
return defaultResult // may be undefined
|
|
982
|
-
|
|
980
|
+
;
|
|
983
981
|
}
|
|
984
982
|
}
|
|
985
983
|
exports.compareIdentifiers = compareIdentifiers;
|
|
@@ -1023,13 +1021,13 @@ function requireSemver() {
|
|
|
1023
1021
|
}
|
|
1024
1022
|
exports.sort = sort;
|
|
1025
1023
|
function sort(list, loose) {
|
|
1026
|
-
return list.sort(function
|
|
1024
|
+
return list.sort(function(a, b) {
|
|
1027
1025
|
return exports.compare(a, b, loose);
|
|
1028
1026
|
});
|
|
1029
1027
|
}
|
|
1030
1028
|
exports.rsort = rsort;
|
|
1031
1029
|
function rsort(list, loose) {
|
|
1032
|
-
return list.sort(function
|
|
1030
|
+
return list.sort(function(a, b) {
|
|
1033
1031
|
return exports.rcompare(a, b, loose);
|
|
1034
1032
|
});
|
|
1035
1033
|
}
|
|
@@ -1059,7 +1057,7 @@ function requireSemver() {
|
|
|
1059
1057
|
}
|
|
1060
1058
|
exports.cmp = cmp;
|
|
1061
1059
|
function cmp(a, op, b, loose) {
|
|
1062
|
-
switch
|
|
1060
|
+
switch(op){
|
|
1063
1061
|
case '===':
|
|
1064
1062
|
if ((typeof a === "undefined" ? "undefined" : _type_of(a)) === 'object') a = a.version;
|
|
1065
1063
|
if ((typeof b === "undefined" ? "undefined" : _type_of(b)) === 'object') b = b.version;
|
|
@@ -1117,7 +1115,7 @@ function requireSemver() {
|
|
|
1117
1115
|
debug('comp', this);
|
|
1118
1116
|
}
|
|
1119
1117
|
var ANY = {};
|
|
1120
|
-
Comparator.prototype.parse = function
|
|
1118
|
+
Comparator.prototype.parse = function(comp) {
|
|
1121
1119
|
var r = this.options.loose ? safeRe[COMPARATORLOOSE] : safeRe[COMPARATOR];
|
|
1122
1120
|
var m = comp.match(r);
|
|
1123
1121
|
if (!m) {
|
|
@@ -1134,10 +1132,10 @@ function requireSemver() {
|
|
|
1134
1132
|
this.semver = new SemVer(m[2], this.options.loose);
|
|
1135
1133
|
}
|
|
1136
1134
|
};
|
|
1137
|
-
Comparator.prototype.toString = function
|
|
1135
|
+
Comparator.prototype.toString = function() {
|
|
1138
1136
|
return this.value;
|
|
1139
1137
|
};
|
|
1140
|
-
Comparator.prototype.test = function
|
|
1138
|
+
Comparator.prototype.test = function(version) {
|
|
1141
1139
|
debug('Comparator.test', version, this.options.loose);
|
|
1142
1140
|
if (this.semver === ANY) {
|
|
1143
1141
|
return true;
|
|
@@ -1147,7 +1145,7 @@ function requireSemver() {
|
|
|
1147
1145
|
}
|
|
1148
1146
|
return cmp(version, this.operator, this.semver, this.options);
|
|
1149
1147
|
};
|
|
1150
|
-
Comparator.prototype.intersects = function
|
|
1148
|
+
Comparator.prototype.intersects = function(comp, options) {
|
|
1151
1149
|
if (!_instanceof(comp, Comparator)) {
|
|
1152
1150
|
throw new TypeError('a Comparator is required');
|
|
1153
1151
|
}
|
|
@@ -1202,9 +1200,9 @@ function requireSemver() {
|
|
|
1202
1200
|
// future error messages as well.
|
|
1203
1201
|
this.raw = range.trim().split(/\s+/).join(' ');
|
|
1204
1202
|
// First, split based on boolean or ||
|
|
1205
|
-
this.set = this.raw.split('||').map(function
|
|
1203
|
+
this.set = this.raw.split('||').map(function(range) {
|
|
1206
1204
|
return this.parseRange(range.trim());
|
|
1207
|
-
}, this).filter(function
|
|
1205
|
+
}, this).filter(function(c) {
|
|
1208
1206
|
// throw out any that are not relevant for whatever reason
|
|
1209
1207
|
return c.length;
|
|
1210
1208
|
});
|
|
@@ -1213,16 +1211,16 @@ function requireSemver() {
|
|
|
1213
1211
|
}
|
|
1214
1212
|
this.format();
|
|
1215
1213
|
}
|
|
1216
|
-
Range.prototype.format = function
|
|
1217
|
-
this.range = this.set.map(function
|
|
1214
|
+
Range.prototype.format = function() {
|
|
1215
|
+
this.range = this.set.map(function(comps) {
|
|
1218
1216
|
return comps.join(' ').trim();
|
|
1219
1217
|
}).join('||').trim();
|
|
1220
1218
|
return this.range;
|
|
1221
1219
|
};
|
|
1222
|
-
Range.prototype.toString = function
|
|
1220
|
+
Range.prototype.toString = function() {
|
|
1223
1221
|
return this.range;
|
|
1224
1222
|
};
|
|
1225
|
-
Range.prototype.parseRange = function
|
|
1223
|
+
Range.prototype.parseRange = function(range) {
|
|
1226
1224
|
var loose = this.options.loose;
|
|
1227
1225
|
// `1.2.3 - 1.2.4` => `>=1.2.3 <=1.2.4`
|
|
1228
1226
|
var hr = loose ? safeRe[HYPHENRANGELOOSE] : safeRe[HYPHENRANGE];
|
|
@@ -1238,28 +1236,28 @@ function requireSemver() {
|
|
|
1238
1236
|
// At this point, the range is completely trimmed and
|
|
1239
1237
|
// ready to be split into comparators.
|
|
1240
1238
|
var compRe = loose ? safeRe[COMPARATORLOOSE] : safeRe[COMPARATOR];
|
|
1241
|
-
var set = range.split(' ').map(function
|
|
1239
|
+
var set = range.split(' ').map(function(comp) {
|
|
1242
1240
|
return parseComparator(comp, this.options);
|
|
1243
1241
|
}, this).join(' ').split(/\s+/);
|
|
1244
1242
|
if (this.options.loose) {
|
|
1245
1243
|
// in loose mode, throw out any that are not valid comparators
|
|
1246
|
-
set = set.filter(function
|
|
1244
|
+
set = set.filter(function(comp) {
|
|
1247
1245
|
return !!comp.match(compRe);
|
|
1248
1246
|
});
|
|
1249
1247
|
}
|
|
1250
|
-
set = set.map(function
|
|
1248
|
+
set = set.map(function(comp) {
|
|
1251
1249
|
return new Comparator(comp, this.options);
|
|
1252
1250
|
}, this);
|
|
1253
1251
|
return set;
|
|
1254
1252
|
};
|
|
1255
|
-
Range.prototype.intersects = function
|
|
1253
|
+
Range.prototype.intersects = function(range, options) {
|
|
1256
1254
|
if (!_instanceof(range, Range)) {
|
|
1257
1255
|
throw new TypeError('a Range is required');
|
|
1258
1256
|
}
|
|
1259
|
-
return this.set.some(function
|
|
1260
|
-
return thisComparators.every(function
|
|
1261
|
-
return range.set.some(function
|
|
1262
|
-
return rangeComparators.every(function
|
|
1257
|
+
return this.set.some(function(thisComparators) {
|
|
1258
|
+
return thisComparators.every(function(thisComparator) {
|
|
1259
|
+
return range.set.some(function(rangeComparators) {
|
|
1260
|
+
return rangeComparators.every(function(rangeComparator) {
|
|
1263
1261
|
return thisComparator.intersects(rangeComparator, options);
|
|
1264
1262
|
});
|
|
1265
1263
|
});
|
|
@@ -1269,8 +1267,8 @@ function requireSemver() {
|
|
|
1269
1267
|
// Mostly just for testing and legacy API reasons
|
|
1270
1268
|
exports.toComparators = toComparators;
|
|
1271
1269
|
function toComparators(range, options) {
|
|
1272
|
-
return new Range(range, options).set.map(function
|
|
1273
|
-
return comp.map(function
|
|
1270
|
+
return new Range(range, options).set.map(function(comp) {
|
|
1271
|
+
return comp.map(function(c) {
|
|
1274
1272
|
return c.value;
|
|
1275
1273
|
}).join(' ').trim().split(' ');
|
|
1276
1274
|
});
|
|
@@ -1300,13 +1298,13 @@ function requireSemver() {
|
|
|
1300
1298
|
// ~1.2.3, ~>1.2.3 --> >=1.2.3 <1.3.0
|
|
1301
1299
|
// ~1.2.0, ~>1.2.0 --> >=1.2.0 <1.3.0
|
|
1302
1300
|
function replaceTildes(comp, options) {
|
|
1303
|
-
return comp.trim().split(/\s+/).map(function
|
|
1301
|
+
return comp.trim().split(/\s+/).map(function(comp) {
|
|
1304
1302
|
return replaceTilde(comp, options);
|
|
1305
1303
|
}).join(' ');
|
|
1306
1304
|
}
|
|
1307
1305
|
function replaceTilde(comp, options) {
|
|
1308
1306
|
var r = options.loose ? safeRe[TILDELOOSE] : safeRe[TILDE];
|
|
1309
|
-
return comp.replace(r, function
|
|
1307
|
+
return comp.replace(r, function(_, M, m, p, pr) {
|
|
1310
1308
|
debug('tilde', comp, _, M, m, p, pr);
|
|
1311
1309
|
var ret;
|
|
1312
1310
|
if (isX(M)) {
|
|
@@ -1334,14 +1332,14 @@ function requireSemver() {
|
|
|
1334
1332
|
// ^1.2.3 --> >=1.2.3 <2.0.0
|
|
1335
1333
|
// ^1.2.0 --> >=1.2.0 <2.0.0
|
|
1336
1334
|
function replaceCarets(comp, options) {
|
|
1337
|
-
return comp.trim().split(/\s+/).map(function
|
|
1335
|
+
return comp.trim().split(/\s+/).map(function(comp) {
|
|
1338
1336
|
return replaceCaret(comp, options);
|
|
1339
1337
|
}).join(' ');
|
|
1340
1338
|
}
|
|
1341
1339
|
function replaceCaret(comp, options) {
|
|
1342
1340
|
debug('caret', comp, options);
|
|
1343
1341
|
var r = options.loose ? safeRe[CARETLOOSE] : safeRe[CARET];
|
|
1344
|
-
return comp.replace(r, function
|
|
1342
|
+
return comp.replace(r, function(_, M, m, p, pr) {
|
|
1345
1343
|
debug('caret', comp, _, M, m, p, pr);
|
|
1346
1344
|
var ret;
|
|
1347
1345
|
if (isX(M)) {
|
|
@@ -1383,14 +1381,14 @@ function requireSemver() {
|
|
|
1383
1381
|
}
|
|
1384
1382
|
function replaceXRanges(comp, options) {
|
|
1385
1383
|
debug('replaceXRanges', comp, options);
|
|
1386
|
-
return comp.split(/\s+/).map(function
|
|
1384
|
+
return comp.split(/\s+/).map(function(comp) {
|
|
1387
1385
|
return replaceXRange(comp, options);
|
|
1388
1386
|
}).join(' ');
|
|
1389
1387
|
}
|
|
1390
1388
|
function replaceXRange(comp, options) {
|
|
1391
1389
|
comp = comp.trim();
|
|
1392
1390
|
var r = options.loose ? safeRe[XRANGELOOSE] : safeRe[XRANGE];
|
|
1393
|
-
return comp.replace(r, function
|
|
1391
|
+
return comp.replace(r, function(ret, gtlt, M, m, p, pr) {
|
|
1394
1392
|
debug('xRange', comp, ret, gtlt, M, m, p, pr);
|
|
1395
1393
|
var xM = isX(M);
|
|
1396
1394
|
var xm = xM || isX(m);
|
|
@@ -1483,14 +1481,14 @@ function requireSemver() {
|
|
|
1483
1481
|
return (from + ' ' + to).trim();
|
|
1484
1482
|
}
|
|
1485
1483
|
// if ANY of the sets match ALL of its comparators, then pass
|
|
1486
|
-
Range.prototype.test = function
|
|
1484
|
+
Range.prototype.test = function(version) {
|
|
1487
1485
|
if (!version) {
|
|
1488
1486
|
return false;
|
|
1489
1487
|
}
|
|
1490
1488
|
if (typeof version === 'string') {
|
|
1491
1489
|
version = new SemVer(version, this.options);
|
|
1492
1490
|
}
|
|
1493
|
-
for
|
|
1491
|
+
for(var i = 0; i < this.set.length; i++){
|
|
1494
1492
|
if (testSet(this.set[i], version, this.options)) {
|
|
1495
1493
|
return true;
|
|
1496
1494
|
}
|
|
@@ -1498,7 +1496,7 @@ function requireSemver() {
|
|
|
1498
1496
|
return false;
|
|
1499
1497
|
};
|
|
1500
1498
|
function testSet(set, version, options) {
|
|
1501
|
-
for
|
|
1499
|
+
for(var i = 0; i < set.length; i++){
|
|
1502
1500
|
if (!set[i].test(version)) {
|
|
1503
1501
|
return false;
|
|
1504
1502
|
}
|
|
@@ -1509,7 +1507,7 @@ function requireSemver() {
|
|
|
1509
1507
|
// That should allow `1.2.3-pr.2` to pass.
|
|
1510
1508
|
// However, `1.2.4-alpha.notready` should NOT be allowed,
|
|
1511
1509
|
// even though it's within the range set by the comparators.
|
|
1512
|
-
for
|
|
1510
|
+
for(i = 0; i < set.length; i++){
|
|
1513
1511
|
debug(set[i].semver);
|
|
1514
1512
|
if (set[i].semver === ANY) {
|
|
1515
1513
|
continue;
|
|
@@ -1544,7 +1542,7 @@ function requireSemver() {
|
|
|
1544
1542
|
} catch (er) {
|
|
1545
1543
|
return null;
|
|
1546
1544
|
}
|
|
1547
|
-
versions.forEach(function
|
|
1545
|
+
versions.forEach(function(v) {
|
|
1548
1546
|
if (rangeObj.test(v)) {
|
|
1549
1547
|
// satisfies(v, range, options)
|
|
1550
1548
|
if (!max || maxSV.compare(v) === -1) {
|
|
@@ -1565,7 +1563,7 @@ function requireSemver() {
|
|
|
1565
1563
|
} catch (er) {
|
|
1566
1564
|
return null;
|
|
1567
1565
|
}
|
|
1568
|
-
versions.forEach(function
|
|
1566
|
+
versions.forEach(function(v) {
|
|
1569
1567
|
if (rangeObj.test(v)) {
|
|
1570
1568
|
// satisfies(v, range, options)
|
|
1571
1569
|
if (!min || minSV.compare(v) === 1) {
|
|
@@ -1589,12 +1587,12 @@ function requireSemver() {
|
|
|
1589
1587
|
return minver;
|
|
1590
1588
|
}
|
|
1591
1589
|
minver = null;
|
|
1592
|
-
for
|
|
1590
|
+
for(var i = 0; i < range.set.length; ++i){
|
|
1593
1591
|
var comparators = range.set[i];
|
|
1594
|
-
comparators.forEach(function
|
|
1592
|
+
comparators.forEach(function(comparator) {
|
|
1595
1593
|
// Clone to avoid manipulating the comparator's semver object.
|
|
1596
1594
|
var compver = new SemVer(comparator.semver.version);
|
|
1597
|
-
switch
|
|
1595
|
+
switch(comparator.operator){
|
|
1598
1596
|
case '>':
|
|
1599
1597
|
if (compver.prerelease.length === 0) {
|
|
1600
1598
|
compver.patch++;
|
|
@@ -1646,7 +1644,7 @@ function requireSemver() {
|
|
|
1646
1644
|
version = new SemVer(version, options);
|
|
1647
1645
|
range = new Range(range, options);
|
|
1648
1646
|
var gtfn, ltefn, ltfn, comp, ecomp;
|
|
1649
|
-
switch
|
|
1647
|
+
switch(hilo){
|
|
1650
1648
|
case '>':
|
|
1651
1649
|
gtfn = gt;
|
|
1652
1650
|
ltefn = lte;
|
|
@@ -1670,11 +1668,11 @@ function requireSemver() {
|
|
|
1670
1668
|
}
|
|
1671
1669
|
// From now on, variable terms are as if we're in "gtr" mode.
|
|
1672
1670
|
// but note that everything is flipped for the "ltr" function.
|
|
1673
|
-
for
|
|
1671
|
+
for(var i = 0; i < range.set.length; ++i){
|
|
1674
1672
|
var comparators = range.set[i];
|
|
1675
1673
|
var high = null;
|
|
1676
1674
|
var low = null;
|
|
1677
|
-
comparators.forEach(function
|
|
1675
|
+
comparators.forEach(function(comparator) {
|
|
1678
1676
|
if (comparator.semver === ANY) {
|
|
1679
1677
|
comparator = new Comparator('>=0.0.0');
|
|
1680
1678
|
}
|
|
@@ -1745,7 +1743,7 @@ function requireParse() {
|
|
|
1745
1743
|
var isExecutableRegExp = /\.(?:com|exe)$/i;
|
|
1746
1744
|
var isCmdShimRegExp = /node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;
|
|
1747
1745
|
// `options.shell` is supported in Node ^4.8.0, ^5.7.0 and >= 6.0.0
|
|
1748
|
-
var supportsShellOption = niceTry(function
|
|
1746
|
+
var supportsShellOption = niceTry(function() {
|
|
1749
1747
|
return semver.satisfies(process.version, '^4.8.0 || ^5.7.0 || >= 6.0.0', true);
|
|
1750
1748
|
}) || false;
|
|
1751
1749
|
function detectShebang(parsed) {
|
|
@@ -1779,7 +1777,7 @@ function requireParse() {
|
|
|
1779
1777
|
parsed.command = path.normalize(parsed.command);
|
|
1780
1778
|
// Escape command & arguments
|
|
1781
1779
|
parsed.command = escape.command(parsed.command);
|
|
1782
|
-
parsed.args = parsed.args.map(function
|
|
1780
|
+
parsed.args = parsed.args.map(function(arg) {
|
|
1783
1781
|
return escape.argument(arg, needsDoubleEscapeMetaChars);
|
|
1784
1782
|
});
|
|
1785
1783
|
var shellCommand = [
|
|
@@ -1876,7 +1874,7 @@ function requireEnoent() {
|
|
|
1876
1874
|
return;
|
|
1877
1875
|
}
|
|
1878
1876
|
var originalEmit = cp.emit;
|
|
1879
|
-
cp.emit = function
|
|
1877
|
+
cp.emit = function(name, arg1) {
|
|
1880
1878
|
// If emitting "exit" event and exit code is 1, we need to check if
|
|
1881
1879
|
// the command exists and emit an "error" instead
|
|
1882
1880
|
// See https://github.com/IndigoUnited/node-cross-spawn/issues/16
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cross-spawn-cb",
|
|
3
|
-
"version": "2.3.
|
|
3
|
+
"version": "2.3.7",
|
|
4
4
|
"description": "Cross spawn with a completion callback",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"cross-spawn",
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
},
|
|
36
36
|
"dependencies": {
|
|
37
37
|
"cross-spawn": "^7.0.6",
|
|
38
|
-
"function-exec-sync": "^1.
|
|
38
|
+
"function-exec-sync": "^1.4.0",
|
|
39
39
|
"on-one": "^0.1.9"
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {
|