@slicemachine/init 1.1.16-dev-alpha.4 → 1.1.16-dev-alpha.6
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/build/index.js +376 -1091
- package/build/index.js.map +1 -1
- package/package.json +4 -4
- package/src/utils/versionCheck.ts +4 -3
package/build/index.js
CHANGED
|
@@ -457,7 +457,15 @@ async function lsfiles(dir) {
|
|
|
457
457
|
});
|
|
458
458
|
}
|
|
459
459
|
|
|
460
|
-
|
|
460
|
+
const debug$3 = (
|
|
461
|
+
typeof process === 'object' &&
|
|
462
|
+
process.env &&
|
|
463
|
+
process.env.NODE_DEBUG &&
|
|
464
|
+
/\bsemver\b/i.test(process.env.NODE_DEBUG)
|
|
465
|
+
) ? (...args) => console.error('SEMVER', ...args)
|
|
466
|
+
: () => {};
|
|
467
|
+
|
|
468
|
+
var debug_1 = debug$3;
|
|
461
469
|
|
|
462
470
|
// Note: this is the semver.org version of the spec that it implements
|
|
463
471
|
// Not necessarily the package version of this code.
|
|
@@ -470,25 +478,17 @@ const MAX_SAFE_INTEGER$1 = Number.MAX_SAFE_INTEGER ||
|
|
|
470
478
|
// Max safe segment length for coercion.
|
|
471
479
|
const MAX_SAFE_COMPONENT_LENGTH = 16;
|
|
472
480
|
|
|
473
|
-
var constants
|
|
481
|
+
var constants = {
|
|
474
482
|
SEMVER_SPEC_VERSION,
|
|
475
483
|
MAX_LENGTH: MAX_LENGTH$2,
|
|
476
484
|
MAX_SAFE_INTEGER: MAX_SAFE_INTEGER$1,
|
|
477
485
|
MAX_SAFE_COMPONENT_LENGTH,
|
|
478
486
|
};
|
|
479
487
|
|
|
480
|
-
|
|
481
|
-
typeof process === 'object' &&
|
|
482
|
-
process.env &&
|
|
483
|
-
process.env.NODE_DEBUG &&
|
|
484
|
-
/\bsemver\b/i.test(process.env.NODE_DEBUG)
|
|
485
|
-
) ? (...args) => console.error('SEMVER', ...args)
|
|
486
|
-
: () => {};
|
|
487
|
-
|
|
488
|
-
var debug_1 = debug$3;
|
|
488
|
+
var re$5 = {exports: {}};
|
|
489
489
|
|
|
490
490
|
(function (module, exports) {
|
|
491
|
-
const { MAX_SAFE_COMPONENT_LENGTH } = constants
|
|
491
|
+
const { MAX_SAFE_COMPONENT_LENGTH } = constants;
|
|
492
492
|
const debug = debug_1;
|
|
493
493
|
exports = module.exports = {};
|
|
494
494
|
|
|
@@ -703,22 +703,22 @@ const compareIdentifiers$1 = (a, b) => {
|
|
|
703
703
|
|
|
704
704
|
const rcompareIdentifiers = (a, b) => compareIdentifiers$1(b, a);
|
|
705
705
|
|
|
706
|
-
var identifiers
|
|
706
|
+
var identifiers = {
|
|
707
707
|
compareIdentifiers: compareIdentifiers$1,
|
|
708
708
|
rcompareIdentifiers,
|
|
709
709
|
};
|
|
710
710
|
|
|
711
711
|
const debug$2 = debug_1;
|
|
712
|
-
const { MAX_LENGTH: MAX_LENGTH$1, MAX_SAFE_INTEGER } = constants
|
|
712
|
+
const { MAX_LENGTH: MAX_LENGTH$1, MAX_SAFE_INTEGER } = constants;
|
|
713
713
|
const { re: re$4, t: t$4 } = re$5.exports;
|
|
714
714
|
|
|
715
715
|
const parseOptions$3 = parseOptions_1;
|
|
716
|
-
const { compareIdentifiers } = identifiers
|
|
717
|
-
class SemVer$
|
|
716
|
+
const { compareIdentifiers } = identifiers;
|
|
717
|
+
class SemVer$5 {
|
|
718
718
|
constructor (version, options) {
|
|
719
719
|
options = parseOptions$3(options);
|
|
720
720
|
|
|
721
|
-
if (version instanceof SemVer$
|
|
721
|
+
if (version instanceof SemVer$5) {
|
|
722
722
|
if (version.loose === !!options.loose &&
|
|
723
723
|
version.includePrerelease === !!options.includePrerelease) {
|
|
724
724
|
return version
|
|
@@ -800,11 +800,11 @@ class SemVer$f {
|
|
|
800
800
|
|
|
801
801
|
compare (other) {
|
|
802
802
|
debug$2('SemVer.compare', this.version, this.options, other);
|
|
803
|
-
if (!(other instanceof SemVer$
|
|
803
|
+
if (!(other instanceof SemVer$5)) {
|
|
804
804
|
if (typeof other === 'string' && other === this.version) {
|
|
805
805
|
return 0
|
|
806
806
|
}
|
|
807
|
-
other = new SemVer$
|
|
807
|
+
other = new SemVer$5(other, this.options);
|
|
808
808
|
}
|
|
809
809
|
|
|
810
810
|
if (other.version === this.version) {
|
|
@@ -815,8 +815,8 @@ class SemVer$f {
|
|
|
815
815
|
}
|
|
816
816
|
|
|
817
817
|
compareMain (other) {
|
|
818
|
-
if (!(other instanceof SemVer$
|
|
819
|
-
other = new SemVer$
|
|
818
|
+
if (!(other instanceof SemVer$5)) {
|
|
819
|
+
other = new SemVer$5(other, this.options);
|
|
820
820
|
}
|
|
821
821
|
|
|
822
822
|
return (
|
|
@@ -827,8 +827,8 @@ class SemVer$f {
|
|
|
827
827
|
}
|
|
828
828
|
|
|
829
829
|
comparePre (other) {
|
|
830
|
-
if (!(other instanceof SemVer$
|
|
831
|
-
other = new SemVer$
|
|
830
|
+
if (!(other instanceof SemVer$5)) {
|
|
831
|
+
other = new SemVer$5(other, this.options);
|
|
832
832
|
}
|
|
833
833
|
|
|
834
834
|
// NOT having a prerelease is > having one
|
|
@@ -860,8 +860,8 @@ class SemVer$f {
|
|
|
860
860
|
}
|
|
861
861
|
|
|
862
862
|
compareBuild (other) {
|
|
863
|
-
if (!(other instanceof SemVer$
|
|
864
|
-
other = new SemVer$
|
|
863
|
+
if (!(other instanceof SemVer$5)) {
|
|
864
|
+
other = new SemVer$5(other, this.options);
|
|
865
865
|
}
|
|
866
866
|
|
|
867
867
|
let i = 0;
|
|
@@ -994,17 +994,17 @@ class SemVer$f {
|
|
|
994
994
|
}
|
|
995
995
|
}
|
|
996
996
|
|
|
997
|
-
var semver
|
|
997
|
+
var semver = SemVer$5;
|
|
998
998
|
|
|
999
|
-
const { MAX_LENGTH } = constants
|
|
999
|
+
const { MAX_LENGTH } = constants;
|
|
1000
1000
|
const { re: re$3, t: t$3 } = re$5.exports;
|
|
1001
|
-
const SemVer$
|
|
1001
|
+
const SemVer$4 = semver;
|
|
1002
1002
|
|
|
1003
1003
|
const parseOptions$2 = parseOptions_1;
|
|
1004
|
-
const parse$
|
|
1004
|
+
const parse$1 = (version, options) => {
|
|
1005
1005
|
options = parseOptions$2(options);
|
|
1006
1006
|
|
|
1007
|
-
if (version instanceof SemVer$
|
|
1007
|
+
if (version instanceof SemVer$4) {
|
|
1008
1008
|
return version
|
|
1009
1009
|
}
|
|
1010
1010
|
|
|
@@ -1022,203 +1022,20 @@ const parse$6 = (version, options) => {
|
|
|
1022
1022
|
}
|
|
1023
1023
|
|
|
1024
1024
|
try {
|
|
1025
|
-
return new SemVer$
|
|
1026
|
-
} catch (er) {
|
|
1027
|
-
return null
|
|
1028
|
-
}
|
|
1029
|
-
};
|
|
1030
|
-
|
|
1031
|
-
var parse_1 = parse$6;
|
|
1032
|
-
|
|
1033
|
-
const parse$5 = parse_1;
|
|
1034
|
-
const valid$2 = (version, options) => {
|
|
1035
|
-
const v = parse$5(version, options);
|
|
1036
|
-
return v ? v.version : null
|
|
1037
|
-
};
|
|
1038
|
-
var valid_1 = valid$2;
|
|
1039
|
-
|
|
1040
|
-
const parse$4 = parse_1;
|
|
1041
|
-
const clean$1 = (version, options) => {
|
|
1042
|
-
const s = parse$4(version.trim().replace(/^[=v]+/, ''), options);
|
|
1043
|
-
return s ? s.version : null
|
|
1044
|
-
};
|
|
1045
|
-
var clean_1 = clean$1;
|
|
1046
|
-
|
|
1047
|
-
const SemVer$d = semver$1;
|
|
1048
|
-
|
|
1049
|
-
const inc$1 = (version, release, options, identifier) => {
|
|
1050
|
-
if (typeof (options) === 'string') {
|
|
1051
|
-
identifier = options;
|
|
1052
|
-
options = undefined;
|
|
1053
|
-
}
|
|
1054
|
-
|
|
1055
|
-
try {
|
|
1056
|
-
return new SemVer$d(
|
|
1057
|
-
version instanceof SemVer$d ? version.version : version,
|
|
1058
|
-
options
|
|
1059
|
-
).inc(release, identifier).version
|
|
1025
|
+
return new SemVer$4(version, options)
|
|
1060
1026
|
} catch (er) {
|
|
1061
1027
|
return null
|
|
1062
1028
|
}
|
|
1063
1029
|
};
|
|
1064
|
-
var inc_1 = inc$1;
|
|
1065
|
-
|
|
1066
|
-
const SemVer$c = semver$1;
|
|
1067
|
-
const compare$b = (a, b, loose) =>
|
|
1068
|
-
new SemVer$c(a, loose).compare(new SemVer$c(b, loose));
|
|
1069
|
-
|
|
1070
|
-
var compare_1 = compare$b;
|
|
1071
|
-
|
|
1072
|
-
const compare$a = compare_1;
|
|
1073
|
-
const eq$3 = (a, b, loose) => compare$a(a, b, loose) === 0;
|
|
1074
|
-
var eq_1 = eq$3;
|
|
1075
|
-
|
|
1076
|
-
const parse$3 = parse_1;
|
|
1077
|
-
const eq$2 = eq_1;
|
|
1078
|
-
|
|
1079
|
-
const diff$1 = (version1, version2) => {
|
|
1080
|
-
if (eq$2(version1, version2)) {
|
|
1081
|
-
return null
|
|
1082
|
-
} else {
|
|
1083
|
-
const v1 = parse$3(version1);
|
|
1084
|
-
const v2 = parse$3(version2);
|
|
1085
|
-
const hasPre = v1.prerelease.length || v2.prerelease.length;
|
|
1086
|
-
const prefix = hasPre ? 'pre' : '';
|
|
1087
|
-
const defaultResult = hasPre ? 'prerelease' : '';
|
|
1088
|
-
for (const key in v1) {
|
|
1089
|
-
if (key === 'major' || key === 'minor' || key === 'patch') {
|
|
1090
|
-
if (v1[key] !== v2[key]) {
|
|
1091
|
-
return prefix + key
|
|
1092
|
-
}
|
|
1093
|
-
}
|
|
1094
|
-
}
|
|
1095
|
-
return defaultResult // may be undefined
|
|
1096
|
-
}
|
|
1097
|
-
};
|
|
1098
|
-
var diff_1 = diff$1;
|
|
1099
|
-
|
|
1100
|
-
const SemVer$b = semver$1;
|
|
1101
|
-
const major$1 = (a, loose) => new SemVer$b(a, loose).major;
|
|
1102
|
-
var major_1 = major$1;
|
|
1103
|
-
|
|
1104
|
-
const SemVer$a = semver$1;
|
|
1105
|
-
const minor$1 = (a, loose) => new SemVer$a(a, loose).minor;
|
|
1106
|
-
var minor_1 = minor$1;
|
|
1107
|
-
|
|
1108
|
-
const SemVer$9 = semver$1;
|
|
1109
|
-
const patch$1 = (a, loose) => new SemVer$9(a, loose).patch;
|
|
1110
|
-
var patch_1 = patch$1;
|
|
1111
|
-
|
|
1112
|
-
const parse$2 = parse_1;
|
|
1113
|
-
const prerelease$1 = (version, options) => {
|
|
1114
|
-
const parsed = parse$2(version, options);
|
|
1115
|
-
return (parsed && parsed.prerelease.length) ? parsed.prerelease : null
|
|
1116
|
-
};
|
|
1117
|
-
var prerelease_1 = prerelease$1;
|
|
1118
|
-
|
|
1119
|
-
const compare$9 = compare_1;
|
|
1120
|
-
const rcompare$1 = (a, b, loose) => compare$9(b, a, loose);
|
|
1121
|
-
var rcompare_1 = rcompare$1;
|
|
1122
|
-
|
|
1123
|
-
const compare$8 = compare_1;
|
|
1124
|
-
const compareLoose$1 = (a, b) => compare$8(a, b, true);
|
|
1125
|
-
var compareLoose_1 = compareLoose$1;
|
|
1126
|
-
|
|
1127
|
-
const SemVer$8 = semver$1;
|
|
1128
|
-
const compareBuild$3 = (a, b, loose) => {
|
|
1129
|
-
const versionA = new SemVer$8(a, loose);
|
|
1130
|
-
const versionB = new SemVer$8(b, loose);
|
|
1131
|
-
return versionA.compare(versionB) || versionA.compareBuild(versionB)
|
|
1132
|
-
};
|
|
1133
|
-
var compareBuild_1 = compareBuild$3;
|
|
1134
|
-
|
|
1135
|
-
const compareBuild$2 = compareBuild_1;
|
|
1136
|
-
const sort$1 = (list, loose) => list.sort((a, b) => compareBuild$2(a, b, loose));
|
|
1137
|
-
var sort_1 = sort$1;
|
|
1138
|
-
|
|
1139
|
-
const compareBuild$1 = compareBuild_1;
|
|
1140
|
-
const rsort$1 = (list, loose) => list.sort((a, b) => compareBuild$1(b, a, loose));
|
|
1141
|
-
var rsort_1 = rsort$1;
|
|
1142
|
-
|
|
1143
|
-
const compare$7 = compare_1;
|
|
1144
|
-
const gt$4 = (a, b, loose) => compare$7(a, b, loose) > 0;
|
|
1145
|
-
var gt_1 = gt$4;
|
|
1146
|
-
|
|
1147
|
-
const compare$6 = compare_1;
|
|
1148
|
-
const lt$3 = (a, b, loose) => compare$6(a, b, loose) < 0;
|
|
1149
|
-
var lt_1 = lt$3;
|
|
1150
|
-
|
|
1151
|
-
const compare$5 = compare_1;
|
|
1152
|
-
const neq$2 = (a, b, loose) => compare$5(a, b, loose) !== 0;
|
|
1153
|
-
var neq_1 = neq$2;
|
|
1154
|
-
|
|
1155
|
-
const compare$4 = compare_1;
|
|
1156
|
-
const gte$3 = (a, b, loose) => compare$4(a, b, loose) >= 0;
|
|
1157
|
-
var gte_1 = gte$3;
|
|
1158
|
-
|
|
1159
|
-
const compare$3 = compare_1;
|
|
1160
|
-
const lte$3 = (a, b, loose) => compare$3(a, b, loose) <= 0;
|
|
1161
|
-
var lte_1 = lte$3;
|
|
1162
|
-
|
|
1163
|
-
const eq$1 = eq_1;
|
|
1164
|
-
const neq$1 = neq_1;
|
|
1165
|
-
const gt$3 = gt_1;
|
|
1166
|
-
const gte$2 = gte_1;
|
|
1167
|
-
const lt$2 = lt_1;
|
|
1168
|
-
const lte$2 = lte_1;
|
|
1169
|
-
|
|
1170
|
-
const cmp$2 = (a, op, b, loose) => {
|
|
1171
|
-
switch (op) {
|
|
1172
|
-
case '===':
|
|
1173
|
-
if (typeof a === 'object') {
|
|
1174
|
-
a = a.version;
|
|
1175
|
-
}
|
|
1176
|
-
if (typeof b === 'object') {
|
|
1177
|
-
b = b.version;
|
|
1178
|
-
}
|
|
1179
|
-
return a === b
|
|
1180
|
-
|
|
1181
|
-
case '!==':
|
|
1182
|
-
if (typeof a === 'object') {
|
|
1183
|
-
a = a.version;
|
|
1184
|
-
}
|
|
1185
|
-
if (typeof b === 'object') {
|
|
1186
|
-
b = b.version;
|
|
1187
|
-
}
|
|
1188
|
-
return a !== b
|
|
1189
|
-
|
|
1190
|
-
case '':
|
|
1191
|
-
case '=':
|
|
1192
|
-
case '==':
|
|
1193
|
-
return eq$1(a, b, loose)
|
|
1194
|
-
|
|
1195
|
-
case '!=':
|
|
1196
|
-
return neq$1(a, b, loose)
|
|
1197
|
-
|
|
1198
|
-
case '>':
|
|
1199
|
-
return gt$3(a, b, loose)
|
|
1200
|
-
|
|
1201
|
-
case '>=':
|
|
1202
|
-
return gte$2(a, b, loose)
|
|
1203
|
-
|
|
1204
|
-
case '<':
|
|
1205
|
-
return lt$2(a, b, loose)
|
|
1206
|
-
|
|
1207
|
-
case '<=':
|
|
1208
|
-
return lte$2(a, b, loose)
|
|
1209
1030
|
|
|
1210
|
-
|
|
1211
|
-
throw new TypeError(`Invalid operator: ${op}`)
|
|
1212
|
-
}
|
|
1213
|
-
};
|
|
1214
|
-
var cmp_1 = cmp$2;
|
|
1031
|
+
var parse_1 = parse$1;
|
|
1215
1032
|
|
|
1216
|
-
const SemVer$
|
|
1217
|
-
const parse
|
|
1033
|
+
const SemVer$3 = semver;
|
|
1034
|
+
const parse = parse_1;
|
|
1218
1035
|
const { re: re$2, t: t$2 } = re$5.exports;
|
|
1219
1036
|
|
|
1220
|
-
const coerce
|
|
1221
|
-
if (version instanceof SemVer$
|
|
1037
|
+
const coerce = (version, options) => {
|
|
1038
|
+
if (version instanceof SemVer$3) {
|
|
1222
1039
|
return version
|
|
1223
1040
|
}
|
|
1224
1041
|
|
|
@@ -1262,9 +1079,9 @@ const coerce$1 = (version, options) => {
|
|
|
1262
1079
|
return null
|
|
1263
1080
|
}
|
|
1264
1081
|
|
|
1265
|
-
return parse
|
|
1082
|
+
return parse(`${match[2]}.${match[3] || '0'}.${match[4] || '0'}`, options)
|
|
1266
1083
|
};
|
|
1267
|
-
var coerce_1 = coerce
|
|
1084
|
+
var coerce_1 = coerce;
|
|
1268
1085
|
|
|
1269
1086
|
var iterator = function (Yallist) {
|
|
1270
1087
|
Yallist.prototype[Symbol.iterator] = function* () {
|
|
@@ -2033,110 +1850,330 @@ const forEachStep = (self, fn, node, thisp) => {
|
|
|
2033
1850
|
|
|
2034
1851
|
var lruCache = LRUCache;
|
|
2035
1852
|
|
|
1853
|
+
const SemVer$2 = semver;
|
|
1854
|
+
const compare$6 = (a, b, loose) =>
|
|
1855
|
+
new SemVer$2(a, loose).compare(new SemVer$2(b, loose));
|
|
1856
|
+
|
|
1857
|
+
var compare_1 = compare$6;
|
|
1858
|
+
|
|
1859
|
+
const compare$5 = compare_1;
|
|
1860
|
+
const eq$1 = (a, b, loose) => compare$5(a, b, loose) === 0;
|
|
1861
|
+
var eq_1 = eq$1;
|
|
1862
|
+
|
|
1863
|
+
const compare$4 = compare_1;
|
|
1864
|
+
const neq$1 = (a, b, loose) => compare$4(a, b, loose) !== 0;
|
|
1865
|
+
var neq_1 = neq$1;
|
|
1866
|
+
|
|
1867
|
+
const compare$3 = compare_1;
|
|
1868
|
+
const gt$1 = (a, b, loose) => compare$3(a, b, loose) > 0;
|
|
1869
|
+
var gt_1 = gt$1;
|
|
1870
|
+
|
|
1871
|
+
const compare$2 = compare_1;
|
|
1872
|
+
const gte$1 = (a, b, loose) => compare$2(a, b, loose) >= 0;
|
|
1873
|
+
var gte_1 = gte$1;
|
|
1874
|
+
|
|
1875
|
+
const compare$1 = compare_1;
|
|
1876
|
+
const lt$1 = (a, b, loose) => compare$1(a, b, loose) < 0;
|
|
1877
|
+
var lt_1 = lt$1;
|
|
1878
|
+
|
|
1879
|
+
const compare = compare_1;
|
|
1880
|
+
const lte$1 = (a, b, loose) => compare(a, b, loose) <= 0;
|
|
1881
|
+
var lte_1 = lte$1;
|
|
1882
|
+
|
|
1883
|
+
const eq = eq_1;
|
|
1884
|
+
const neq = neq_1;
|
|
1885
|
+
const gt = gt_1;
|
|
1886
|
+
const gte = gte_1;
|
|
1887
|
+
const lt = lt_1;
|
|
1888
|
+
const lte = lte_1;
|
|
1889
|
+
|
|
1890
|
+
const cmp$1 = (a, op, b, loose) => {
|
|
1891
|
+
switch (op) {
|
|
1892
|
+
case '===':
|
|
1893
|
+
if (typeof a === 'object') {
|
|
1894
|
+
a = a.version;
|
|
1895
|
+
}
|
|
1896
|
+
if (typeof b === 'object') {
|
|
1897
|
+
b = b.version;
|
|
1898
|
+
}
|
|
1899
|
+
return a === b
|
|
1900
|
+
|
|
1901
|
+
case '!==':
|
|
1902
|
+
if (typeof a === 'object') {
|
|
1903
|
+
a = a.version;
|
|
1904
|
+
}
|
|
1905
|
+
if (typeof b === 'object') {
|
|
1906
|
+
b = b.version;
|
|
1907
|
+
}
|
|
1908
|
+
return a !== b
|
|
1909
|
+
|
|
1910
|
+
case '':
|
|
1911
|
+
case '=':
|
|
1912
|
+
case '==':
|
|
1913
|
+
return eq(a, b, loose)
|
|
1914
|
+
|
|
1915
|
+
case '!=':
|
|
1916
|
+
return neq(a, b, loose)
|
|
1917
|
+
|
|
1918
|
+
case '>':
|
|
1919
|
+
return gt(a, b, loose)
|
|
1920
|
+
|
|
1921
|
+
case '>=':
|
|
1922
|
+
return gte(a, b, loose)
|
|
1923
|
+
|
|
1924
|
+
case '<':
|
|
1925
|
+
return lt(a, b, loose)
|
|
1926
|
+
|
|
1927
|
+
case '<=':
|
|
1928
|
+
return lte(a, b, loose)
|
|
1929
|
+
|
|
1930
|
+
default:
|
|
1931
|
+
throw new TypeError(`Invalid operator: ${op}`)
|
|
1932
|
+
}
|
|
1933
|
+
};
|
|
1934
|
+
var cmp_1 = cmp$1;
|
|
1935
|
+
|
|
1936
|
+
const ANY = Symbol('SemVer ANY');
|
|
2036
1937
|
// hoisted class for cyclic dependency
|
|
2037
|
-
class
|
|
2038
|
-
|
|
1938
|
+
class Comparator$1 {
|
|
1939
|
+
static get ANY () {
|
|
1940
|
+
return ANY
|
|
1941
|
+
}
|
|
1942
|
+
|
|
1943
|
+
constructor (comp, options) {
|
|
2039
1944
|
options = parseOptions$1(options);
|
|
2040
1945
|
|
|
2041
|
-
if (
|
|
2042
|
-
if (
|
|
2043
|
-
|
|
2044
|
-
range.includePrerelease === !!options.includePrerelease
|
|
2045
|
-
) {
|
|
2046
|
-
return range
|
|
1946
|
+
if (comp instanceof Comparator$1) {
|
|
1947
|
+
if (comp.loose === !!options.loose) {
|
|
1948
|
+
return comp
|
|
2047
1949
|
} else {
|
|
2048
|
-
|
|
1950
|
+
comp = comp.value;
|
|
2049
1951
|
}
|
|
2050
1952
|
}
|
|
2051
1953
|
|
|
2052
|
-
|
|
2053
|
-
// just put it in the set and return
|
|
2054
|
-
this.raw = range.value;
|
|
2055
|
-
this.set = [[range]];
|
|
2056
|
-
this.format();
|
|
2057
|
-
return this
|
|
2058
|
-
}
|
|
2059
|
-
|
|
1954
|
+
debug$1('comparator', comp, options);
|
|
2060
1955
|
this.options = options;
|
|
2061
1956
|
this.loose = !!options.loose;
|
|
2062
|
-
this.
|
|
2063
|
-
|
|
2064
|
-
// First, split based on boolean or ||
|
|
2065
|
-
this.raw = range;
|
|
2066
|
-
this.set = range
|
|
2067
|
-
.split('||')
|
|
2068
|
-
// map the range to a 2d array of comparators
|
|
2069
|
-
.map(r => this.parseRange(r.trim()))
|
|
2070
|
-
// throw out any comparator lists that are empty
|
|
2071
|
-
// this generally means that it was not a valid range, which is allowed
|
|
2072
|
-
// in loose mode, but will still throw if the WHOLE range is invalid.
|
|
2073
|
-
.filter(c => c.length);
|
|
1957
|
+
this.parse(comp);
|
|
2074
1958
|
|
|
2075
|
-
if (
|
|
2076
|
-
|
|
1959
|
+
if (this.semver === ANY) {
|
|
1960
|
+
this.value = '';
|
|
1961
|
+
} else {
|
|
1962
|
+
this.value = this.operator + this.semver.version;
|
|
2077
1963
|
}
|
|
2078
1964
|
|
|
2079
|
-
|
|
2080
|
-
|
|
2081
|
-
|
|
2082
|
-
|
|
2083
|
-
|
|
2084
|
-
|
|
2085
|
-
|
|
2086
|
-
|
|
2087
|
-
|
|
2088
|
-
for (const c of this.set) {
|
|
2089
|
-
if (c.length === 1 && isAny(c[0])) {
|
|
2090
|
-
this.set = [c];
|
|
2091
|
-
break
|
|
2092
|
-
}
|
|
2093
|
-
}
|
|
2094
|
-
}
|
|
1965
|
+
debug$1('comp', this);
|
|
1966
|
+
}
|
|
1967
|
+
|
|
1968
|
+
parse (comp) {
|
|
1969
|
+
const r = this.options.loose ? re$1[t$1.COMPARATORLOOSE] : re$1[t$1.COMPARATOR];
|
|
1970
|
+
const m = comp.match(r);
|
|
1971
|
+
|
|
1972
|
+
if (!m) {
|
|
1973
|
+
throw new TypeError(`Invalid comparator: ${comp}`)
|
|
2095
1974
|
}
|
|
2096
1975
|
|
|
2097
|
-
this.
|
|
2098
|
-
|
|
1976
|
+
this.operator = m[1] !== undefined ? m[1] : '';
|
|
1977
|
+
if (this.operator === '=') {
|
|
1978
|
+
this.operator = '';
|
|
1979
|
+
}
|
|
2099
1980
|
|
|
2100
|
-
|
|
2101
|
-
|
|
2102
|
-
.
|
|
2103
|
-
|
|
2104
|
-
|
|
2105
|
-
|
|
2106
|
-
.trim();
|
|
2107
|
-
return this.range
|
|
1981
|
+
// if it literally is just '>' or '' then allow anything.
|
|
1982
|
+
if (!m[2]) {
|
|
1983
|
+
this.semver = ANY;
|
|
1984
|
+
} else {
|
|
1985
|
+
this.semver = new SemVer$1(m[2], this.options.loose);
|
|
1986
|
+
}
|
|
2108
1987
|
}
|
|
2109
1988
|
|
|
2110
1989
|
toString () {
|
|
2111
|
-
return this.
|
|
1990
|
+
return this.value
|
|
2112
1991
|
}
|
|
2113
1992
|
|
|
2114
|
-
|
|
2115
|
-
|
|
1993
|
+
test (version) {
|
|
1994
|
+
debug$1('Comparator.test', version, this.options.loose);
|
|
2116
1995
|
|
|
2117
|
-
|
|
2118
|
-
|
|
2119
|
-
const memoOpts = Object.keys(this.options).join(',');
|
|
2120
|
-
const memoKey = `parseRange:${memoOpts}:${range}`;
|
|
2121
|
-
const cached = cache.get(memoKey);
|
|
2122
|
-
if (cached) {
|
|
2123
|
-
return cached
|
|
1996
|
+
if (this.semver === ANY || version === ANY) {
|
|
1997
|
+
return true
|
|
2124
1998
|
}
|
|
2125
1999
|
|
|
2126
|
-
|
|
2000
|
+
if (typeof version === 'string') {
|
|
2001
|
+
try {
|
|
2002
|
+
version = new SemVer$1(version, this.options);
|
|
2003
|
+
} catch (er) {
|
|
2004
|
+
return false
|
|
2005
|
+
}
|
|
2006
|
+
}
|
|
2007
|
+
|
|
2008
|
+
return cmp(version, this.operator, this.semver, this.options)
|
|
2009
|
+
}
|
|
2010
|
+
|
|
2011
|
+
intersects (comp, options) {
|
|
2012
|
+
if (!(comp instanceof Comparator$1)) {
|
|
2013
|
+
throw new TypeError('a Comparator is required')
|
|
2014
|
+
}
|
|
2015
|
+
|
|
2016
|
+
if (!options || typeof options !== 'object') {
|
|
2017
|
+
options = {
|
|
2018
|
+
loose: !!options,
|
|
2019
|
+
includePrerelease: false,
|
|
2020
|
+
};
|
|
2021
|
+
}
|
|
2022
|
+
|
|
2023
|
+
if (this.operator === '') {
|
|
2024
|
+
if (this.value === '') {
|
|
2025
|
+
return true
|
|
2026
|
+
}
|
|
2027
|
+
return new Range$2(comp.value, options).test(this.value)
|
|
2028
|
+
} else if (comp.operator === '') {
|
|
2029
|
+
if (comp.value === '') {
|
|
2030
|
+
return true
|
|
2031
|
+
}
|
|
2032
|
+
return new Range$2(this.value, options).test(comp.semver)
|
|
2033
|
+
}
|
|
2034
|
+
|
|
2035
|
+
const sameDirectionIncreasing =
|
|
2036
|
+
(this.operator === '>=' || this.operator === '>') &&
|
|
2037
|
+
(comp.operator === '>=' || comp.operator === '>');
|
|
2038
|
+
const sameDirectionDecreasing =
|
|
2039
|
+
(this.operator === '<=' || this.operator === '<') &&
|
|
2040
|
+
(comp.operator === '<=' || comp.operator === '<');
|
|
2041
|
+
const sameSemVer = this.semver.version === comp.semver.version;
|
|
2042
|
+
const differentDirectionsInclusive =
|
|
2043
|
+
(this.operator === '>=' || this.operator === '<=') &&
|
|
2044
|
+
(comp.operator === '>=' || comp.operator === '<=');
|
|
2045
|
+
const oppositeDirectionsLessThan =
|
|
2046
|
+
cmp(this.semver, '<', comp.semver, options) &&
|
|
2047
|
+
(this.operator === '>=' || this.operator === '>') &&
|
|
2048
|
+
(comp.operator === '<=' || comp.operator === '<');
|
|
2049
|
+
const oppositeDirectionsGreaterThan =
|
|
2050
|
+
cmp(this.semver, '>', comp.semver, options) &&
|
|
2051
|
+
(this.operator === '<=' || this.operator === '<') &&
|
|
2052
|
+
(comp.operator === '>=' || comp.operator === '>');
|
|
2053
|
+
|
|
2054
|
+
return (
|
|
2055
|
+
sameDirectionIncreasing ||
|
|
2056
|
+
sameDirectionDecreasing ||
|
|
2057
|
+
(sameSemVer && differentDirectionsInclusive) ||
|
|
2058
|
+
oppositeDirectionsLessThan ||
|
|
2059
|
+
oppositeDirectionsGreaterThan
|
|
2060
|
+
)
|
|
2061
|
+
}
|
|
2062
|
+
}
|
|
2063
|
+
|
|
2064
|
+
var comparator = Comparator$1;
|
|
2065
|
+
|
|
2066
|
+
const parseOptions$1 = parseOptions_1;
|
|
2067
|
+
const { re: re$1, t: t$1 } = re$5.exports;
|
|
2068
|
+
const cmp = cmp_1;
|
|
2069
|
+
const debug$1 = debug_1;
|
|
2070
|
+
const SemVer$1 = semver;
|
|
2071
|
+
const Range$2 = range;
|
|
2072
|
+
|
|
2073
|
+
// hoisted class for cyclic dependency
|
|
2074
|
+
class Range$1 {
|
|
2075
|
+
constructor (range, options) {
|
|
2076
|
+
options = parseOptions(options);
|
|
2077
|
+
|
|
2078
|
+
if (range instanceof Range$1) {
|
|
2079
|
+
if (
|
|
2080
|
+
range.loose === !!options.loose &&
|
|
2081
|
+
range.includePrerelease === !!options.includePrerelease
|
|
2082
|
+
) {
|
|
2083
|
+
return range
|
|
2084
|
+
} else {
|
|
2085
|
+
return new Range$1(range.raw, options)
|
|
2086
|
+
}
|
|
2087
|
+
}
|
|
2088
|
+
|
|
2089
|
+
if (range instanceof Comparator) {
|
|
2090
|
+
// just put it in the set and return
|
|
2091
|
+
this.raw = range.value;
|
|
2092
|
+
this.set = [[range]];
|
|
2093
|
+
this.format();
|
|
2094
|
+
return this
|
|
2095
|
+
}
|
|
2096
|
+
|
|
2097
|
+
this.options = options;
|
|
2098
|
+
this.loose = !!options.loose;
|
|
2099
|
+
this.includePrerelease = !!options.includePrerelease;
|
|
2100
|
+
|
|
2101
|
+
// First, split based on boolean or ||
|
|
2102
|
+
this.raw = range;
|
|
2103
|
+
this.set = range
|
|
2104
|
+
.split('||')
|
|
2105
|
+
// map the range to a 2d array of comparators
|
|
2106
|
+
.map(r => this.parseRange(r.trim()))
|
|
2107
|
+
// throw out any comparator lists that are empty
|
|
2108
|
+
// this generally means that it was not a valid range, which is allowed
|
|
2109
|
+
// in loose mode, but will still throw if the WHOLE range is invalid.
|
|
2110
|
+
.filter(c => c.length);
|
|
2111
|
+
|
|
2112
|
+
if (!this.set.length) {
|
|
2113
|
+
throw new TypeError(`Invalid SemVer Range: ${range}`)
|
|
2114
|
+
}
|
|
2115
|
+
|
|
2116
|
+
// if we have any that are not the null set, throw out null sets.
|
|
2117
|
+
if (this.set.length > 1) {
|
|
2118
|
+
// keep the first one, in case they're all null sets
|
|
2119
|
+
const first = this.set[0];
|
|
2120
|
+
this.set = this.set.filter(c => !isNullSet(c[0]));
|
|
2121
|
+
if (this.set.length === 0) {
|
|
2122
|
+
this.set = [first];
|
|
2123
|
+
} else if (this.set.length > 1) {
|
|
2124
|
+
// if we have any that are *, then the range is just *
|
|
2125
|
+
for (const c of this.set) {
|
|
2126
|
+
if (c.length === 1 && isAny(c[0])) {
|
|
2127
|
+
this.set = [c];
|
|
2128
|
+
break
|
|
2129
|
+
}
|
|
2130
|
+
}
|
|
2131
|
+
}
|
|
2132
|
+
}
|
|
2133
|
+
|
|
2134
|
+
this.format();
|
|
2135
|
+
}
|
|
2136
|
+
|
|
2137
|
+
format () {
|
|
2138
|
+
this.range = this.set
|
|
2139
|
+
.map((comps) => {
|
|
2140
|
+
return comps.join(' ').trim()
|
|
2141
|
+
})
|
|
2142
|
+
.join('||')
|
|
2143
|
+
.trim();
|
|
2144
|
+
return this.range
|
|
2145
|
+
}
|
|
2146
|
+
|
|
2147
|
+
toString () {
|
|
2148
|
+
return this.range
|
|
2149
|
+
}
|
|
2150
|
+
|
|
2151
|
+
parseRange (range) {
|
|
2152
|
+
range = range.trim();
|
|
2153
|
+
|
|
2154
|
+
// memoize range parsing for performance.
|
|
2155
|
+
// this is a very hot path, and fully deterministic.
|
|
2156
|
+
const memoOpts = Object.keys(this.options).join(',');
|
|
2157
|
+
const memoKey = `parseRange:${memoOpts}:${range}`;
|
|
2158
|
+
const cached = cache.get(memoKey);
|
|
2159
|
+
if (cached) {
|
|
2160
|
+
return cached
|
|
2161
|
+
}
|
|
2162
|
+
|
|
2163
|
+
const loose = this.options.loose;
|
|
2127
2164
|
// `1.2.3 - 1.2.4` => `>=1.2.3 <=1.2.4`
|
|
2128
|
-
const hr = loose ? re
|
|
2165
|
+
const hr = loose ? re[t.HYPHENRANGELOOSE] : re[t.HYPHENRANGE];
|
|
2129
2166
|
range = range.replace(hr, hyphenReplace(this.options.includePrerelease));
|
|
2130
|
-
debug
|
|
2167
|
+
debug('hyphen replace', range);
|
|
2131
2168
|
// `> 1.2.3 < 1.2.5` => `>1.2.3 <1.2.5`
|
|
2132
|
-
range = range.replace(re
|
|
2133
|
-
debug
|
|
2169
|
+
range = range.replace(re[t.COMPARATORTRIM], comparatorTrimReplace);
|
|
2170
|
+
debug('comparator trim', range);
|
|
2134
2171
|
|
|
2135
2172
|
// `~ 1.2.3` => `~1.2.3`
|
|
2136
|
-
range = range.replace(re
|
|
2173
|
+
range = range.replace(re[t.TILDETRIM], tildeTrimReplace);
|
|
2137
2174
|
|
|
2138
2175
|
// `^ 1.2.3` => `^1.2.3`
|
|
2139
|
-
range = range.replace(re
|
|
2176
|
+
range = range.replace(re[t.CARETTRIM], caretTrimReplace);
|
|
2140
2177
|
|
|
2141
2178
|
// normalize spaces
|
|
2142
2179
|
range = range.split(/\s+/).join(' ');
|
|
@@ -2155,17 +2192,17 @@ class Range$b {
|
|
|
2155
2192
|
if (loose) {
|
|
2156
2193
|
// in loose mode, throw out any that are not valid comparators
|
|
2157
2194
|
rangeList = rangeList.filter(comp => {
|
|
2158
|
-
debug
|
|
2159
|
-
return !!comp.match(re
|
|
2195
|
+
debug('loose invalid filter', comp, this.options);
|
|
2196
|
+
return !!comp.match(re[t.COMPARATORLOOSE])
|
|
2160
2197
|
});
|
|
2161
2198
|
}
|
|
2162
|
-
debug
|
|
2199
|
+
debug('range list', rangeList);
|
|
2163
2200
|
|
|
2164
2201
|
// if any comparators are the null set, then replace with JUST null set
|
|
2165
2202
|
// if more than one comparator, remove any * comparators
|
|
2166
2203
|
// also, don't include the same comparator more than once
|
|
2167
2204
|
const rangeMap = new Map();
|
|
2168
|
-
const comparators = rangeList.map(comp => new Comparator
|
|
2205
|
+
const comparators = rangeList.map(comp => new Comparator(comp, this.options));
|
|
2169
2206
|
for (const comp of comparators) {
|
|
2170
2207
|
if (isNullSet(comp)) {
|
|
2171
2208
|
return [comp]
|
|
@@ -2182,7 +2219,7 @@ class Range$b {
|
|
|
2182
2219
|
}
|
|
2183
2220
|
|
|
2184
2221
|
intersects (range, options) {
|
|
2185
|
-
if (!(range instanceof Range$
|
|
2222
|
+
if (!(range instanceof Range$1)) {
|
|
2186
2223
|
throw new TypeError('a Range is required')
|
|
2187
2224
|
}
|
|
2188
2225
|
|
|
@@ -2211,7 +2248,7 @@ class Range$b {
|
|
|
2211
2248
|
|
|
2212
2249
|
if (typeof version === 'string') {
|
|
2213
2250
|
try {
|
|
2214
|
-
version = new SemVer
|
|
2251
|
+
version = new SemVer(version, this.options);
|
|
2215
2252
|
} catch (er) {
|
|
2216
2253
|
return false
|
|
2217
2254
|
}
|
|
@@ -2225,18 +2262,18 @@ class Range$b {
|
|
|
2225
2262
|
return false
|
|
2226
2263
|
}
|
|
2227
2264
|
}
|
|
2228
|
-
var range = Range$
|
|
2265
|
+
var range = Range$1;
|
|
2229
2266
|
|
|
2230
2267
|
const LRU = lruCache;
|
|
2231
2268
|
const cache = new LRU({ max: 1000 });
|
|
2232
2269
|
|
|
2233
|
-
const parseOptions
|
|
2234
|
-
const Comparator
|
|
2235
|
-
const debug
|
|
2236
|
-
const SemVer
|
|
2270
|
+
const parseOptions = parseOptions_1;
|
|
2271
|
+
const Comparator = comparator;
|
|
2272
|
+
const debug = debug_1;
|
|
2273
|
+
const SemVer = semver;
|
|
2237
2274
|
const {
|
|
2238
|
-
re
|
|
2239
|
-
t
|
|
2275
|
+
re,
|
|
2276
|
+
t,
|
|
2240
2277
|
comparatorTrimReplace,
|
|
2241
2278
|
tildeTrimReplace,
|
|
2242
2279
|
caretTrimReplace,
|
|
@@ -2267,15 +2304,15 @@ const isSatisfiable = (comparators, options) => {
|
|
|
2267
2304
|
// already replaced the hyphen ranges
|
|
2268
2305
|
// turn into a set of JUST comparators.
|
|
2269
2306
|
const parseComparator = (comp, options) => {
|
|
2270
|
-
debug
|
|
2307
|
+
debug('comp', comp, options);
|
|
2271
2308
|
comp = replaceCarets(comp, options);
|
|
2272
|
-
debug
|
|
2309
|
+
debug('caret', comp);
|
|
2273
2310
|
comp = replaceTildes(comp, options);
|
|
2274
|
-
debug
|
|
2311
|
+
debug('tildes', comp);
|
|
2275
2312
|
comp = replaceXRanges(comp, options);
|
|
2276
|
-
debug
|
|
2313
|
+
debug('xrange', comp);
|
|
2277
2314
|
comp = replaceStars(comp, options);
|
|
2278
|
-
debug
|
|
2315
|
+
debug('stars', comp);
|
|
2279
2316
|
return comp
|
|
2280
2317
|
};
|
|
2281
2318
|
|
|
@@ -2294,9 +2331,9 @@ const replaceTildes = (comp, options) =>
|
|
|
2294
2331
|
}).join(' ');
|
|
2295
2332
|
|
|
2296
2333
|
const replaceTilde = (comp, options) => {
|
|
2297
|
-
const r = options.loose ? re
|
|
2334
|
+
const r = options.loose ? re[t.TILDELOOSE] : re[t.TILDE];
|
|
2298
2335
|
return comp.replace(r, (_, M, m, p, pr) => {
|
|
2299
|
-
debug
|
|
2336
|
+
debug('tilde', comp, _, M, m, p, pr);
|
|
2300
2337
|
let ret;
|
|
2301
2338
|
|
|
2302
2339
|
if (isX(M)) {
|
|
@@ -2307,7 +2344,7 @@ const replaceTilde = (comp, options) => {
|
|
|
2307
2344
|
// ~1.2 == >=1.2.0 <1.3.0-0
|
|
2308
2345
|
ret = `>=${M}.${m}.0 <${M}.${+m + 1}.0-0`;
|
|
2309
2346
|
} else if (pr) {
|
|
2310
|
-
debug
|
|
2347
|
+
debug('replaceTilde pr', pr);
|
|
2311
2348
|
ret = `>=${M}.${m}.${p}-${pr
|
|
2312
2349
|
} <${M}.${+m + 1}.0-0`;
|
|
2313
2350
|
} else {
|
|
@@ -2316,7 +2353,7 @@ const replaceTilde = (comp, options) => {
|
|
|
2316
2353
|
} <${M}.${+m + 1}.0-0`;
|
|
2317
2354
|
}
|
|
2318
2355
|
|
|
2319
|
-
debug
|
|
2356
|
+
debug('tilde return', ret);
|
|
2320
2357
|
return ret
|
|
2321
2358
|
})
|
|
2322
2359
|
};
|
|
@@ -2335,11 +2372,11 @@ const replaceCarets = (comp, options) =>
|
|
|
2335
2372
|
}).join(' ');
|
|
2336
2373
|
|
|
2337
2374
|
const replaceCaret = (comp, options) => {
|
|
2338
|
-
debug
|
|
2339
|
-
const r = options.loose ? re
|
|
2375
|
+
debug('caret', comp, options);
|
|
2376
|
+
const r = options.loose ? re[t.CARETLOOSE] : re[t.CARET];
|
|
2340
2377
|
const z = options.includePrerelease ? '-0' : '';
|
|
2341
2378
|
return comp.replace(r, (_, M, m, p, pr) => {
|
|
2342
|
-
debug
|
|
2379
|
+
debug('caret', comp, _, M, m, p, pr);
|
|
2343
2380
|
let ret;
|
|
2344
2381
|
|
|
2345
2382
|
if (isX(M)) {
|
|
@@ -2353,7 +2390,7 @@ const replaceCaret = (comp, options) => {
|
|
|
2353
2390
|
ret = `>=${M}.${m}.0${z} <${+M + 1}.0.0-0`;
|
|
2354
2391
|
}
|
|
2355
2392
|
} else if (pr) {
|
|
2356
|
-
debug
|
|
2393
|
+
debug('replaceCaret pr', pr);
|
|
2357
2394
|
if (M === '0') {
|
|
2358
2395
|
if (m === '0') {
|
|
2359
2396
|
ret = `>=${M}.${m}.${p}-${pr
|
|
@@ -2367,7 +2404,7 @@ const replaceCaret = (comp, options) => {
|
|
|
2367
2404
|
} <${+M + 1}.0.0-0`;
|
|
2368
2405
|
}
|
|
2369
2406
|
} else {
|
|
2370
|
-
debug
|
|
2407
|
+
debug('no pr');
|
|
2371
2408
|
if (M === '0') {
|
|
2372
2409
|
if (m === '0') {
|
|
2373
2410
|
ret = `>=${M}.${m}.${p
|
|
@@ -2382,13 +2419,13 @@ const replaceCaret = (comp, options) => {
|
|
|
2382
2419
|
}
|
|
2383
2420
|
}
|
|
2384
2421
|
|
|
2385
|
-
debug
|
|
2422
|
+
debug('caret return', ret);
|
|
2386
2423
|
return ret
|
|
2387
2424
|
})
|
|
2388
2425
|
};
|
|
2389
2426
|
|
|
2390
2427
|
const replaceXRanges = (comp, options) => {
|
|
2391
|
-
debug
|
|
2428
|
+
debug('replaceXRanges', comp, options);
|
|
2392
2429
|
return comp.split(/\s+/).map((c) => {
|
|
2393
2430
|
return replaceXRange(c, options)
|
|
2394
2431
|
}).join(' ')
|
|
@@ -2396,9 +2433,9 @@ const replaceXRanges = (comp, options) => {
|
|
|
2396
2433
|
|
|
2397
2434
|
const replaceXRange = (comp, options) => {
|
|
2398
2435
|
comp = comp.trim();
|
|
2399
|
-
const r = options.loose ? re
|
|
2436
|
+
const r = options.loose ? re[t.XRANGELOOSE] : re[t.XRANGE];
|
|
2400
2437
|
return comp.replace(r, (ret, gtlt, M, m, p, pr) => {
|
|
2401
|
-
debug
|
|
2438
|
+
debug('xRange', comp, ret, gtlt, M, m, p, pr);
|
|
2402
2439
|
const xM = isX(M);
|
|
2403
2440
|
const xm = xM || isX(m);
|
|
2404
2441
|
const xp = xm || isX(p);
|
|
@@ -2463,7 +2500,7 @@ const replaceXRange = (comp, options) => {
|
|
|
2463
2500
|
} <${M}.${+m + 1}.0-0`;
|
|
2464
2501
|
}
|
|
2465
2502
|
|
|
2466
|
-
debug
|
|
2503
|
+
debug('xRange return', ret);
|
|
2467
2504
|
|
|
2468
2505
|
return ret
|
|
2469
2506
|
})
|
|
@@ -2472,15 +2509,15 @@ const replaceXRange = (comp, options) => {
|
|
|
2472
2509
|
// Because * is AND-ed with everything else in the comparator,
|
|
2473
2510
|
// and '' means "any version", just remove the *s entirely.
|
|
2474
2511
|
const replaceStars = (comp, options) => {
|
|
2475
|
-
debug
|
|
2512
|
+
debug('replaceStars', comp, options);
|
|
2476
2513
|
// Looseness is ignored here. star is always as loose as it gets!
|
|
2477
|
-
return comp.trim().replace(re
|
|
2514
|
+
return comp.trim().replace(re[t.STAR], '')
|
|
2478
2515
|
};
|
|
2479
2516
|
|
|
2480
2517
|
const replaceGTE0 = (comp, options) => {
|
|
2481
|
-
debug
|
|
2518
|
+
debug('replaceGTE0', comp, options);
|
|
2482
2519
|
return comp.trim()
|
|
2483
|
-
.replace(re
|
|
2520
|
+
.replace(re[options.includePrerelease ? t.GTE0PRE : t.GTE0], '')
|
|
2484
2521
|
};
|
|
2485
2522
|
|
|
2486
2523
|
// This function is passed to string.replace(re[t.HYPHENRANGE])
|
|
@@ -2534,8 +2571,8 @@ const testSet = (set, version, options) => {
|
|
|
2534
2571
|
// However, `1.2.4-alpha.notready` should NOT be allowed,
|
|
2535
2572
|
// even though it's within the range set by the comparators.
|
|
2536
2573
|
for (let i = 0; i < set.length; i++) {
|
|
2537
|
-
debug
|
|
2538
|
-
if (set[i].semver === Comparator
|
|
2574
|
+
debug(set[i].semver);
|
|
2575
|
+
if (set[i].semver === Comparator.ANY) {
|
|
2539
2576
|
continue
|
|
2540
2577
|
}
|
|
2541
2578
|
|
|
@@ -2556,776 +2593,24 @@ const testSet = (set, version, options) => {
|
|
|
2556
2593
|
return true
|
|
2557
2594
|
};
|
|
2558
2595
|
|
|
2559
|
-
const
|
|
2560
|
-
|
|
2561
|
-
class Comparator$3 {
|
|
2562
|
-
static get ANY () {
|
|
2563
|
-
return ANY$2
|
|
2564
|
-
}
|
|
2565
|
-
|
|
2566
|
-
constructor (comp, options) {
|
|
2567
|
-
options = parseOptions(options);
|
|
2568
|
-
|
|
2569
|
-
if (comp instanceof Comparator$3) {
|
|
2570
|
-
if (comp.loose === !!options.loose) {
|
|
2571
|
-
return comp
|
|
2572
|
-
} else {
|
|
2573
|
-
comp = comp.value;
|
|
2574
|
-
}
|
|
2575
|
-
}
|
|
2576
|
-
|
|
2577
|
-
debug('comparator', comp, options);
|
|
2578
|
-
this.options = options;
|
|
2579
|
-
this.loose = !!options.loose;
|
|
2580
|
-
this.parse(comp);
|
|
2581
|
-
|
|
2582
|
-
if (this.semver === ANY$2) {
|
|
2583
|
-
this.value = '';
|
|
2584
|
-
} else {
|
|
2585
|
-
this.value = this.operator + this.semver.version;
|
|
2586
|
-
}
|
|
2587
|
-
|
|
2588
|
-
debug('comp', this);
|
|
2589
|
-
}
|
|
2590
|
-
|
|
2591
|
-
parse (comp) {
|
|
2592
|
-
const r = this.options.loose ? re[t.COMPARATORLOOSE] : re[t.COMPARATOR];
|
|
2593
|
-
const m = comp.match(r);
|
|
2594
|
-
|
|
2595
|
-
if (!m) {
|
|
2596
|
-
throw new TypeError(`Invalid comparator: ${comp}`)
|
|
2597
|
-
}
|
|
2598
|
-
|
|
2599
|
-
this.operator = m[1] !== undefined ? m[1] : '';
|
|
2600
|
-
if (this.operator === '=') {
|
|
2601
|
-
this.operator = '';
|
|
2602
|
-
}
|
|
2603
|
-
|
|
2604
|
-
// if it literally is just '>' or '' then allow anything.
|
|
2605
|
-
if (!m[2]) {
|
|
2606
|
-
this.semver = ANY$2;
|
|
2607
|
-
} else {
|
|
2608
|
-
this.semver = new SemVer$5(m[2], this.options.loose);
|
|
2609
|
-
}
|
|
2610
|
-
}
|
|
2611
|
-
|
|
2612
|
-
toString () {
|
|
2613
|
-
return this.value
|
|
2614
|
-
}
|
|
2615
|
-
|
|
2616
|
-
test (version) {
|
|
2617
|
-
debug('Comparator.test', version, this.options.loose);
|
|
2618
|
-
|
|
2619
|
-
if (this.semver === ANY$2 || version === ANY$2) {
|
|
2620
|
-
return true
|
|
2621
|
-
}
|
|
2622
|
-
|
|
2623
|
-
if (typeof version === 'string') {
|
|
2624
|
-
try {
|
|
2625
|
-
version = new SemVer$5(version, this.options);
|
|
2626
|
-
} catch (er) {
|
|
2627
|
-
return false
|
|
2628
|
-
}
|
|
2629
|
-
}
|
|
2630
|
-
|
|
2631
|
-
return cmp$1(version, this.operator, this.semver, this.options)
|
|
2632
|
-
}
|
|
2633
|
-
|
|
2634
|
-
intersects (comp, options) {
|
|
2635
|
-
if (!(comp instanceof Comparator$3)) {
|
|
2636
|
-
throw new TypeError('a Comparator is required')
|
|
2637
|
-
}
|
|
2638
|
-
|
|
2639
|
-
if (!options || typeof options !== 'object') {
|
|
2640
|
-
options = {
|
|
2641
|
-
loose: !!options,
|
|
2642
|
-
includePrerelease: false,
|
|
2643
|
-
};
|
|
2644
|
-
}
|
|
2645
|
-
|
|
2646
|
-
if (this.operator === '') {
|
|
2647
|
-
if (this.value === '') {
|
|
2648
|
-
return true
|
|
2649
|
-
}
|
|
2650
|
-
return new Range$a(comp.value, options).test(this.value)
|
|
2651
|
-
} else if (comp.operator === '') {
|
|
2652
|
-
if (comp.value === '') {
|
|
2653
|
-
return true
|
|
2654
|
-
}
|
|
2655
|
-
return new Range$a(this.value, options).test(comp.semver)
|
|
2656
|
-
}
|
|
2657
|
-
|
|
2658
|
-
const sameDirectionIncreasing =
|
|
2659
|
-
(this.operator === '>=' || this.operator === '>') &&
|
|
2660
|
-
(comp.operator === '>=' || comp.operator === '>');
|
|
2661
|
-
const sameDirectionDecreasing =
|
|
2662
|
-
(this.operator === '<=' || this.operator === '<') &&
|
|
2663
|
-
(comp.operator === '<=' || comp.operator === '<');
|
|
2664
|
-
const sameSemVer = this.semver.version === comp.semver.version;
|
|
2665
|
-
const differentDirectionsInclusive =
|
|
2666
|
-
(this.operator === '>=' || this.operator === '<=') &&
|
|
2667
|
-
(comp.operator === '>=' || comp.operator === '<=');
|
|
2668
|
-
const oppositeDirectionsLessThan =
|
|
2669
|
-
cmp$1(this.semver, '<', comp.semver, options) &&
|
|
2670
|
-
(this.operator === '>=' || this.operator === '>') &&
|
|
2671
|
-
(comp.operator === '<=' || comp.operator === '<');
|
|
2672
|
-
const oppositeDirectionsGreaterThan =
|
|
2673
|
-
cmp$1(this.semver, '>', comp.semver, options) &&
|
|
2674
|
-
(this.operator === '<=' || this.operator === '<') &&
|
|
2675
|
-
(comp.operator === '>=' || comp.operator === '>');
|
|
2676
|
-
|
|
2677
|
-
return (
|
|
2678
|
-
sameDirectionIncreasing ||
|
|
2679
|
-
sameDirectionDecreasing ||
|
|
2680
|
-
(sameSemVer && differentDirectionsInclusive) ||
|
|
2681
|
-
oppositeDirectionsLessThan ||
|
|
2682
|
-
oppositeDirectionsGreaterThan
|
|
2683
|
-
)
|
|
2684
|
-
}
|
|
2685
|
-
}
|
|
2686
|
-
|
|
2687
|
-
var comparator = Comparator$3;
|
|
2688
|
-
|
|
2689
|
-
const parseOptions = parseOptions_1;
|
|
2690
|
-
const { re, t } = re$5.exports;
|
|
2691
|
-
const cmp$1 = cmp_1;
|
|
2692
|
-
const debug = debug_1;
|
|
2693
|
-
const SemVer$5 = semver$1;
|
|
2694
|
-
const Range$a = range;
|
|
2695
|
-
|
|
2696
|
-
const Range$9 = range;
|
|
2697
|
-
const satisfies$4 = (version, range, options) => {
|
|
2596
|
+
const Range = range;
|
|
2597
|
+
const satisfies = (version, range, options) => {
|
|
2698
2598
|
try {
|
|
2699
|
-
range = new Range
|
|
2599
|
+
range = new Range(range, options);
|
|
2700
2600
|
} catch (er) {
|
|
2701
2601
|
return false
|
|
2702
2602
|
}
|
|
2703
2603
|
return range.test(version)
|
|
2704
2604
|
};
|
|
2705
|
-
var satisfies_1 = satisfies
|
|
2706
|
-
|
|
2707
|
-
const Range$8 = range;
|
|
2708
|
-
|
|
2709
|
-
// Mostly just for testing and legacy API reasons
|
|
2710
|
-
const toComparators$1 = (range, options) =>
|
|
2711
|
-
new Range$8(range, options).set
|
|
2712
|
-
.map(comp => comp.map(c => c.value).join(' ').trim().split(' '));
|
|
2713
|
-
|
|
2714
|
-
var toComparators_1 = toComparators$1;
|
|
2715
|
-
|
|
2716
|
-
const SemVer$4 = semver$1;
|
|
2717
|
-
const Range$7 = range;
|
|
2718
|
-
|
|
2719
|
-
const maxSatisfying$1 = (versions, range, options) => {
|
|
2720
|
-
let max = null;
|
|
2721
|
-
let maxSV = null;
|
|
2722
|
-
let rangeObj = null;
|
|
2723
|
-
try {
|
|
2724
|
-
rangeObj = new Range$7(range, options);
|
|
2725
|
-
} catch (er) {
|
|
2726
|
-
return null
|
|
2727
|
-
}
|
|
2728
|
-
versions.forEach((v) => {
|
|
2729
|
-
if (rangeObj.test(v)) {
|
|
2730
|
-
// satisfies(v, range, options)
|
|
2731
|
-
if (!max || maxSV.compare(v) === -1) {
|
|
2732
|
-
// compare(max, v, true)
|
|
2733
|
-
max = v;
|
|
2734
|
-
maxSV = new SemVer$4(max, options);
|
|
2735
|
-
}
|
|
2736
|
-
}
|
|
2737
|
-
});
|
|
2738
|
-
return max
|
|
2739
|
-
};
|
|
2740
|
-
var maxSatisfying_1 = maxSatisfying$1;
|
|
2741
|
-
|
|
2742
|
-
const SemVer$3 = semver$1;
|
|
2743
|
-
const Range$6 = range;
|
|
2744
|
-
const minSatisfying$1 = (versions, range, options) => {
|
|
2745
|
-
let min = null;
|
|
2746
|
-
let minSV = null;
|
|
2747
|
-
let rangeObj = null;
|
|
2748
|
-
try {
|
|
2749
|
-
rangeObj = new Range$6(range, options);
|
|
2750
|
-
} catch (er) {
|
|
2751
|
-
return null
|
|
2752
|
-
}
|
|
2753
|
-
versions.forEach((v) => {
|
|
2754
|
-
if (rangeObj.test(v)) {
|
|
2755
|
-
// satisfies(v, range, options)
|
|
2756
|
-
if (!min || minSV.compare(v) === 1) {
|
|
2757
|
-
// compare(min, v, true)
|
|
2758
|
-
min = v;
|
|
2759
|
-
minSV = new SemVer$3(min, options);
|
|
2760
|
-
}
|
|
2761
|
-
}
|
|
2762
|
-
});
|
|
2763
|
-
return min
|
|
2764
|
-
};
|
|
2765
|
-
var minSatisfying_1 = minSatisfying$1;
|
|
2766
|
-
|
|
2767
|
-
const SemVer$2 = semver$1;
|
|
2768
|
-
const Range$5 = range;
|
|
2769
|
-
const gt$2 = gt_1;
|
|
2770
|
-
|
|
2771
|
-
const minVersion$1 = (range, loose) => {
|
|
2772
|
-
range = new Range$5(range, loose);
|
|
2773
|
-
|
|
2774
|
-
let minver = new SemVer$2('0.0.0');
|
|
2775
|
-
if (range.test(minver)) {
|
|
2776
|
-
return minver
|
|
2777
|
-
}
|
|
2778
|
-
|
|
2779
|
-
minver = new SemVer$2('0.0.0-0');
|
|
2780
|
-
if (range.test(minver)) {
|
|
2781
|
-
return minver
|
|
2782
|
-
}
|
|
2783
|
-
|
|
2784
|
-
minver = null;
|
|
2785
|
-
for (let i = 0; i < range.set.length; ++i) {
|
|
2786
|
-
const comparators = range.set[i];
|
|
2787
|
-
|
|
2788
|
-
let setMin = null;
|
|
2789
|
-
comparators.forEach((comparator) => {
|
|
2790
|
-
// Clone to avoid manipulating the comparator's semver object.
|
|
2791
|
-
const compver = new SemVer$2(comparator.semver.version);
|
|
2792
|
-
switch (comparator.operator) {
|
|
2793
|
-
case '>':
|
|
2794
|
-
if (compver.prerelease.length === 0) {
|
|
2795
|
-
compver.patch++;
|
|
2796
|
-
} else {
|
|
2797
|
-
compver.prerelease.push(0);
|
|
2798
|
-
}
|
|
2799
|
-
compver.raw = compver.format();
|
|
2800
|
-
/* fallthrough */
|
|
2801
|
-
case '':
|
|
2802
|
-
case '>=':
|
|
2803
|
-
if (!setMin || gt$2(compver, setMin)) {
|
|
2804
|
-
setMin = compver;
|
|
2805
|
-
}
|
|
2806
|
-
break
|
|
2807
|
-
case '<':
|
|
2808
|
-
case '<=':
|
|
2809
|
-
/* Ignore maximum versions */
|
|
2810
|
-
break
|
|
2811
|
-
/* istanbul ignore next */
|
|
2812
|
-
default:
|
|
2813
|
-
throw new Error(`Unexpected operation: ${comparator.operator}`)
|
|
2814
|
-
}
|
|
2815
|
-
});
|
|
2816
|
-
if (setMin && (!minver || gt$2(minver, setMin))) {
|
|
2817
|
-
minver = setMin;
|
|
2818
|
-
}
|
|
2819
|
-
}
|
|
2820
|
-
|
|
2821
|
-
if (minver && range.test(minver)) {
|
|
2822
|
-
return minver
|
|
2823
|
-
}
|
|
2824
|
-
|
|
2825
|
-
return null
|
|
2826
|
-
};
|
|
2827
|
-
var minVersion_1 = minVersion$1;
|
|
2828
|
-
|
|
2829
|
-
const Range$4 = range;
|
|
2830
|
-
const validRange$1 = (range, options) => {
|
|
2831
|
-
try {
|
|
2832
|
-
// Return '*' instead of '' so that truthiness works.
|
|
2833
|
-
// This will throw if it's invalid anyway
|
|
2834
|
-
return new Range$4(range, options).range || '*'
|
|
2835
|
-
} catch (er) {
|
|
2836
|
-
return null
|
|
2837
|
-
}
|
|
2838
|
-
};
|
|
2839
|
-
var valid$1 = validRange$1;
|
|
2840
|
-
|
|
2841
|
-
const SemVer$1 = semver$1;
|
|
2842
|
-
const Comparator$2 = comparator;
|
|
2843
|
-
const { ANY: ANY$1 } = Comparator$2;
|
|
2844
|
-
const Range$3 = range;
|
|
2845
|
-
const satisfies$3 = satisfies_1;
|
|
2846
|
-
const gt$1 = gt_1;
|
|
2847
|
-
const lt$1 = lt_1;
|
|
2848
|
-
const lte$1 = lte_1;
|
|
2849
|
-
const gte$1 = gte_1;
|
|
2850
|
-
|
|
2851
|
-
const outside$3 = (version, range, hilo, options) => {
|
|
2852
|
-
version = new SemVer$1(version, options);
|
|
2853
|
-
range = new Range$3(range, options);
|
|
2854
|
-
|
|
2855
|
-
let gtfn, ltefn, ltfn, comp, ecomp;
|
|
2856
|
-
switch (hilo) {
|
|
2857
|
-
case '>':
|
|
2858
|
-
gtfn = gt$1;
|
|
2859
|
-
ltefn = lte$1;
|
|
2860
|
-
ltfn = lt$1;
|
|
2861
|
-
comp = '>';
|
|
2862
|
-
ecomp = '>=';
|
|
2863
|
-
break
|
|
2864
|
-
case '<':
|
|
2865
|
-
gtfn = lt$1;
|
|
2866
|
-
ltefn = gte$1;
|
|
2867
|
-
ltfn = gt$1;
|
|
2868
|
-
comp = '<';
|
|
2869
|
-
ecomp = '<=';
|
|
2870
|
-
break
|
|
2871
|
-
default:
|
|
2872
|
-
throw new TypeError('Must provide a hilo val of "<" or ">"')
|
|
2873
|
-
}
|
|
2874
|
-
|
|
2875
|
-
// If it satisfies the range it is not outside
|
|
2876
|
-
if (satisfies$3(version, range, options)) {
|
|
2877
|
-
return false
|
|
2878
|
-
}
|
|
2879
|
-
|
|
2880
|
-
// From now on, variable terms are as if we're in "gtr" mode.
|
|
2881
|
-
// but note that everything is flipped for the "ltr" function.
|
|
2882
|
-
|
|
2883
|
-
for (let i = 0; i < range.set.length; ++i) {
|
|
2884
|
-
const comparators = range.set[i];
|
|
2885
|
-
|
|
2886
|
-
let high = null;
|
|
2887
|
-
let low = null;
|
|
2888
|
-
|
|
2889
|
-
comparators.forEach((comparator) => {
|
|
2890
|
-
if (comparator.semver === ANY$1) {
|
|
2891
|
-
comparator = new Comparator$2('>=0.0.0');
|
|
2892
|
-
}
|
|
2893
|
-
high = high || comparator;
|
|
2894
|
-
low = low || comparator;
|
|
2895
|
-
if (gtfn(comparator.semver, high.semver, options)) {
|
|
2896
|
-
high = comparator;
|
|
2897
|
-
} else if (ltfn(comparator.semver, low.semver, options)) {
|
|
2898
|
-
low = comparator;
|
|
2899
|
-
}
|
|
2900
|
-
});
|
|
2901
|
-
|
|
2902
|
-
// If the edge version comparator has a operator then our version
|
|
2903
|
-
// isn't outside it
|
|
2904
|
-
if (high.operator === comp || high.operator === ecomp) {
|
|
2905
|
-
return false
|
|
2906
|
-
}
|
|
2907
|
-
|
|
2908
|
-
// If the lowest version comparator has an operator and our version
|
|
2909
|
-
// is less than it then it isn't higher than the range
|
|
2910
|
-
if ((!low.operator || low.operator === comp) &&
|
|
2911
|
-
ltefn(version, low.semver)) {
|
|
2912
|
-
return false
|
|
2913
|
-
} else if (low.operator === ecomp && ltfn(version, low.semver)) {
|
|
2914
|
-
return false
|
|
2915
|
-
}
|
|
2916
|
-
}
|
|
2917
|
-
return true
|
|
2918
|
-
};
|
|
2919
|
-
|
|
2920
|
-
var outside_1 = outside$3;
|
|
2921
|
-
|
|
2922
|
-
// Determine if version is greater than all the versions possible in the range.
|
|
2923
|
-
const outside$2 = outside_1;
|
|
2924
|
-
const gtr$1 = (version, range, options) => outside$2(version, range, '>', options);
|
|
2925
|
-
var gtr_1 = gtr$1;
|
|
2926
|
-
|
|
2927
|
-
const outside$1 = outside_1;
|
|
2928
|
-
// Determine if version is less than all the versions possible in the range
|
|
2929
|
-
const ltr$1 = (version, range, options) => outside$1(version, range, '<', options);
|
|
2930
|
-
var ltr_1 = ltr$1;
|
|
2931
|
-
|
|
2932
|
-
const Range$2 = range;
|
|
2933
|
-
const intersects$1 = (r1, r2, options) => {
|
|
2934
|
-
r1 = new Range$2(r1, options);
|
|
2935
|
-
r2 = new Range$2(r2, options);
|
|
2936
|
-
return r1.intersects(r2)
|
|
2937
|
-
};
|
|
2938
|
-
var intersects_1 = intersects$1;
|
|
2939
|
-
|
|
2940
|
-
// given a set of versions and a range, create a "simplified" range
|
|
2941
|
-
// that includes the same versions that the original range does
|
|
2942
|
-
// If the original range is shorter than the simplified one, return that.
|
|
2943
|
-
const satisfies$2 = satisfies_1;
|
|
2944
|
-
const compare$2 = compare_1;
|
|
2945
|
-
var simplify = (versions, range, options) => {
|
|
2946
|
-
const set = [];
|
|
2947
|
-
let first = null;
|
|
2948
|
-
let prev = null;
|
|
2949
|
-
const v = versions.sort((a, b) => compare$2(a, b, options));
|
|
2950
|
-
for (const version of v) {
|
|
2951
|
-
const included = satisfies$2(version, range, options);
|
|
2952
|
-
if (included) {
|
|
2953
|
-
prev = version;
|
|
2954
|
-
if (!first) {
|
|
2955
|
-
first = version;
|
|
2956
|
-
}
|
|
2957
|
-
} else {
|
|
2958
|
-
if (prev) {
|
|
2959
|
-
set.push([first, prev]);
|
|
2960
|
-
}
|
|
2961
|
-
prev = null;
|
|
2962
|
-
first = null;
|
|
2963
|
-
}
|
|
2964
|
-
}
|
|
2965
|
-
if (first) {
|
|
2966
|
-
set.push([first, null]);
|
|
2967
|
-
}
|
|
2968
|
-
|
|
2969
|
-
const ranges = [];
|
|
2970
|
-
for (const [min, max] of set) {
|
|
2971
|
-
if (min === max) {
|
|
2972
|
-
ranges.push(min);
|
|
2973
|
-
} else if (!max && min === v[0]) {
|
|
2974
|
-
ranges.push('*');
|
|
2975
|
-
} else if (!max) {
|
|
2976
|
-
ranges.push(`>=${min}`);
|
|
2977
|
-
} else if (min === v[0]) {
|
|
2978
|
-
ranges.push(`<=${max}`);
|
|
2979
|
-
} else {
|
|
2980
|
-
ranges.push(`${min} - ${max}`);
|
|
2981
|
-
}
|
|
2982
|
-
}
|
|
2983
|
-
const simplified = ranges.join(' || ');
|
|
2984
|
-
const original = typeof range.raw === 'string' ? range.raw : String(range);
|
|
2985
|
-
return simplified.length < original.length ? simplified : range
|
|
2986
|
-
};
|
|
2987
|
-
|
|
2988
|
-
const Range$1 = range;
|
|
2989
|
-
const Comparator$1 = comparator;
|
|
2990
|
-
const { ANY } = Comparator$1;
|
|
2991
|
-
const satisfies$1 = satisfies_1;
|
|
2992
|
-
const compare$1 = compare_1;
|
|
2993
|
-
|
|
2994
|
-
// Complex range `r1 || r2 || ...` is a subset of `R1 || R2 || ...` iff:
|
|
2995
|
-
// - Every simple range `r1, r2, ...` is a null set, OR
|
|
2996
|
-
// - Every simple range `r1, r2, ...` which is not a null set is a subset of
|
|
2997
|
-
// some `R1, R2, ...`
|
|
2998
|
-
//
|
|
2999
|
-
// Simple range `c1 c2 ...` is a subset of simple range `C1 C2 ...` iff:
|
|
3000
|
-
// - If c is only the ANY comparator
|
|
3001
|
-
// - If C is only the ANY comparator, return true
|
|
3002
|
-
// - Else if in prerelease mode, return false
|
|
3003
|
-
// - else replace c with `[>=0.0.0]`
|
|
3004
|
-
// - If C is only the ANY comparator
|
|
3005
|
-
// - if in prerelease mode, return true
|
|
3006
|
-
// - else replace C with `[>=0.0.0]`
|
|
3007
|
-
// - Let EQ be the set of = comparators in c
|
|
3008
|
-
// - If EQ is more than one, return true (null set)
|
|
3009
|
-
// - Let GT be the highest > or >= comparator in c
|
|
3010
|
-
// - Let LT be the lowest < or <= comparator in c
|
|
3011
|
-
// - If GT and LT, and GT.semver > LT.semver, return true (null set)
|
|
3012
|
-
// - If any C is a = range, and GT or LT are set, return false
|
|
3013
|
-
// - If EQ
|
|
3014
|
-
// - If GT, and EQ does not satisfy GT, return true (null set)
|
|
3015
|
-
// - If LT, and EQ does not satisfy LT, return true (null set)
|
|
3016
|
-
// - If EQ satisfies every C, return true
|
|
3017
|
-
// - Else return false
|
|
3018
|
-
// - If GT
|
|
3019
|
-
// - If GT.semver is lower than any > or >= comp in C, return false
|
|
3020
|
-
// - If GT is >=, and GT.semver does not satisfy every C, return false
|
|
3021
|
-
// - If GT.semver has a prerelease, and not in prerelease mode
|
|
3022
|
-
// - If no C has a prerelease and the GT.semver tuple, return false
|
|
3023
|
-
// - If LT
|
|
3024
|
-
// - If LT.semver is greater than any < or <= comp in C, return false
|
|
3025
|
-
// - If LT is <=, and LT.semver does not satisfy every C, return false
|
|
3026
|
-
// - If GT.semver has a prerelease, and not in prerelease mode
|
|
3027
|
-
// - If no C has a prerelease and the LT.semver tuple, return false
|
|
3028
|
-
// - Else return true
|
|
3029
|
-
|
|
3030
|
-
const subset$1 = (sub, dom, options = {}) => {
|
|
3031
|
-
if (sub === dom) {
|
|
3032
|
-
return true
|
|
3033
|
-
}
|
|
3034
|
-
|
|
3035
|
-
sub = new Range$1(sub, options);
|
|
3036
|
-
dom = new Range$1(dom, options);
|
|
3037
|
-
let sawNonNull = false;
|
|
3038
|
-
|
|
3039
|
-
OUTER: for (const simpleSub of sub.set) {
|
|
3040
|
-
for (const simpleDom of dom.set) {
|
|
3041
|
-
const isSub = simpleSubset(simpleSub, simpleDom, options);
|
|
3042
|
-
sawNonNull = sawNonNull || isSub !== null;
|
|
3043
|
-
if (isSub) {
|
|
3044
|
-
continue OUTER
|
|
3045
|
-
}
|
|
3046
|
-
}
|
|
3047
|
-
// the null set is a subset of everything, but null simple ranges in
|
|
3048
|
-
// a complex range should be ignored. so if we saw a non-null range,
|
|
3049
|
-
// then we know this isn't a subset, but if EVERY simple range was null,
|
|
3050
|
-
// then it is a subset.
|
|
3051
|
-
if (sawNonNull) {
|
|
3052
|
-
return false
|
|
3053
|
-
}
|
|
3054
|
-
}
|
|
3055
|
-
return true
|
|
3056
|
-
};
|
|
3057
|
-
|
|
3058
|
-
const simpleSubset = (sub, dom, options) => {
|
|
3059
|
-
if (sub === dom) {
|
|
3060
|
-
return true
|
|
3061
|
-
}
|
|
3062
|
-
|
|
3063
|
-
if (sub.length === 1 && sub[0].semver === ANY) {
|
|
3064
|
-
if (dom.length === 1 && dom[0].semver === ANY) {
|
|
3065
|
-
return true
|
|
3066
|
-
} else if (options.includePrerelease) {
|
|
3067
|
-
sub = [new Comparator$1('>=0.0.0-0')];
|
|
3068
|
-
} else {
|
|
3069
|
-
sub = [new Comparator$1('>=0.0.0')];
|
|
3070
|
-
}
|
|
3071
|
-
}
|
|
3072
|
-
|
|
3073
|
-
if (dom.length === 1 && dom[0].semver === ANY) {
|
|
3074
|
-
if (options.includePrerelease) {
|
|
3075
|
-
return true
|
|
3076
|
-
} else {
|
|
3077
|
-
dom = [new Comparator$1('>=0.0.0')];
|
|
3078
|
-
}
|
|
3079
|
-
}
|
|
3080
|
-
|
|
3081
|
-
const eqSet = new Set();
|
|
3082
|
-
let gt, lt;
|
|
3083
|
-
for (const c of sub) {
|
|
3084
|
-
if (c.operator === '>' || c.operator === '>=') {
|
|
3085
|
-
gt = higherGT(gt, c, options);
|
|
3086
|
-
} else if (c.operator === '<' || c.operator === '<=') {
|
|
3087
|
-
lt = lowerLT(lt, c, options);
|
|
3088
|
-
} else {
|
|
3089
|
-
eqSet.add(c.semver);
|
|
3090
|
-
}
|
|
3091
|
-
}
|
|
3092
|
-
|
|
3093
|
-
if (eqSet.size > 1) {
|
|
3094
|
-
return null
|
|
3095
|
-
}
|
|
3096
|
-
|
|
3097
|
-
let gtltComp;
|
|
3098
|
-
if (gt && lt) {
|
|
3099
|
-
gtltComp = compare$1(gt.semver, lt.semver, options);
|
|
3100
|
-
if (gtltComp > 0) {
|
|
3101
|
-
return null
|
|
3102
|
-
} else if (gtltComp === 0 && (gt.operator !== '>=' || lt.operator !== '<=')) {
|
|
3103
|
-
return null
|
|
3104
|
-
}
|
|
3105
|
-
}
|
|
3106
|
-
|
|
3107
|
-
// will iterate one or zero times
|
|
3108
|
-
for (const eq of eqSet) {
|
|
3109
|
-
if (gt && !satisfies$1(eq, String(gt), options)) {
|
|
3110
|
-
return null
|
|
3111
|
-
}
|
|
3112
|
-
|
|
3113
|
-
if (lt && !satisfies$1(eq, String(lt), options)) {
|
|
3114
|
-
return null
|
|
3115
|
-
}
|
|
3116
|
-
|
|
3117
|
-
for (const c of dom) {
|
|
3118
|
-
if (!satisfies$1(eq, String(c), options)) {
|
|
3119
|
-
return false
|
|
3120
|
-
}
|
|
3121
|
-
}
|
|
3122
|
-
|
|
3123
|
-
return true
|
|
3124
|
-
}
|
|
3125
|
-
|
|
3126
|
-
let higher, lower;
|
|
3127
|
-
let hasDomLT, hasDomGT;
|
|
3128
|
-
// if the subset has a prerelease, we need a comparator in the superset
|
|
3129
|
-
// with the same tuple and a prerelease, or it's not a subset
|
|
3130
|
-
let needDomLTPre = lt &&
|
|
3131
|
-
!options.includePrerelease &&
|
|
3132
|
-
lt.semver.prerelease.length ? lt.semver : false;
|
|
3133
|
-
let needDomGTPre = gt &&
|
|
3134
|
-
!options.includePrerelease &&
|
|
3135
|
-
gt.semver.prerelease.length ? gt.semver : false;
|
|
3136
|
-
// exception: <1.2.3-0 is the same as <1.2.3
|
|
3137
|
-
if (needDomLTPre && needDomLTPre.prerelease.length === 1 &&
|
|
3138
|
-
lt.operator === '<' && needDomLTPre.prerelease[0] === 0) {
|
|
3139
|
-
needDomLTPre = false;
|
|
3140
|
-
}
|
|
3141
|
-
|
|
3142
|
-
for (const c of dom) {
|
|
3143
|
-
hasDomGT = hasDomGT || c.operator === '>' || c.operator === '>=';
|
|
3144
|
-
hasDomLT = hasDomLT || c.operator === '<' || c.operator === '<=';
|
|
3145
|
-
if (gt) {
|
|
3146
|
-
if (needDomGTPre) {
|
|
3147
|
-
if (c.semver.prerelease && c.semver.prerelease.length &&
|
|
3148
|
-
c.semver.major === needDomGTPre.major &&
|
|
3149
|
-
c.semver.minor === needDomGTPre.minor &&
|
|
3150
|
-
c.semver.patch === needDomGTPre.patch) {
|
|
3151
|
-
needDomGTPre = false;
|
|
3152
|
-
}
|
|
3153
|
-
}
|
|
3154
|
-
if (c.operator === '>' || c.operator === '>=') {
|
|
3155
|
-
higher = higherGT(gt, c, options);
|
|
3156
|
-
if (higher === c && higher !== gt) {
|
|
3157
|
-
return false
|
|
3158
|
-
}
|
|
3159
|
-
} else if (gt.operator === '>=' && !satisfies$1(gt.semver, String(c), options)) {
|
|
3160
|
-
return false
|
|
3161
|
-
}
|
|
3162
|
-
}
|
|
3163
|
-
if (lt) {
|
|
3164
|
-
if (needDomLTPre) {
|
|
3165
|
-
if (c.semver.prerelease && c.semver.prerelease.length &&
|
|
3166
|
-
c.semver.major === needDomLTPre.major &&
|
|
3167
|
-
c.semver.minor === needDomLTPre.minor &&
|
|
3168
|
-
c.semver.patch === needDomLTPre.patch) {
|
|
3169
|
-
needDomLTPre = false;
|
|
3170
|
-
}
|
|
3171
|
-
}
|
|
3172
|
-
if (c.operator === '<' || c.operator === '<=') {
|
|
3173
|
-
lower = lowerLT(lt, c, options);
|
|
3174
|
-
if (lower === c && lower !== lt) {
|
|
3175
|
-
return false
|
|
3176
|
-
}
|
|
3177
|
-
} else if (lt.operator === '<=' && !satisfies$1(lt.semver, String(c), options)) {
|
|
3178
|
-
return false
|
|
3179
|
-
}
|
|
3180
|
-
}
|
|
3181
|
-
if (!c.operator && (lt || gt) && gtltComp !== 0) {
|
|
3182
|
-
return false
|
|
3183
|
-
}
|
|
3184
|
-
}
|
|
3185
|
-
|
|
3186
|
-
// if there was a < or >, and nothing in the dom, then must be false
|
|
3187
|
-
// UNLESS it was limited by another range in the other direction.
|
|
3188
|
-
// Eg, >1.0.0 <1.0.1 is still a subset of <2.0.0
|
|
3189
|
-
if (gt && hasDomLT && !lt && gtltComp !== 0) {
|
|
3190
|
-
return false
|
|
3191
|
-
}
|
|
3192
|
-
|
|
3193
|
-
if (lt && hasDomGT && !gt && gtltComp !== 0) {
|
|
3194
|
-
return false
|
|
3195
|
-
}
|
|
3196
|
-
|
|
3197
|
-
// we needed a prerelease range in a specific tuple, but didn't get one
|
|
3198
|
-
// then this isn't a subset. eg >=1.2.3-pre is not a subset of >=1.0.0,
|
|
3199
|
-
// because it includes prereleases in the 1.2.3 tuple
|
|
3200
|
-
if (needDomGTPre || needDomLTPre) {
|
|
3201
|
-
return false
|
|
3202
|
-
}
|
|
3203
|
-
|
|
3204
|
-
return true
|
|
3205
|
-
};
|
|
3206
|
-
|
|
3207
|
-
// >=1.2.3 is lower than >1.2.3
|
|
3208
|
-
const higherGT = (a, b, options) => {
|
|
3209
|
-
if (!a) {
|
|
3210
|
-
return b
|
|
3211
|
-
}
|
|
3212
|
-
const comp = compare$1(a.semver, b.semver, options);
|
|
3213
|
-
return comp > 0 ? a
|
|
3214
|
-
: comp < 0 ? b
|
|
3215
|
-
: b.operator === '>' && a.operator === '>=' ? b
|
|
3216
|
-
: a
|
|
3217
|
-
};
|
|
3218
|
-
|
|
3219
|
-
// <=1.2.3 is higher than <1.2.3
|
|
3220
|
-
const lowerLT = (a, b, options) => {
|
|
3221
|
-
if (!a) {
|
|
3222
|
-
return b
|
|
3223
|
-
}
|
|
3224
|
-
const comp = compare$1(a.semver, b.semver, options);
|
|
3225
|
-
return comp < 0 ? a
|
|
3226
|
-
: comp > 0 ? b
|
|
3227
|
-
: b.operator === '<' && a.operator === '<=' ? b
|
|
3228
|
-
: a
|
|
3229
|
-
};
|
|
3230
|
-
|
|
3231
|
-
var subset_1 = subset$1;
|
|
3232
|
-
|
|
3233
|
-
// just pre-load all the stuff that index.js lazily exports
|
|
3234
|
-
const internalRe = re$5.exports;
|
|
3235
|
-
const constants = constants$1;
|
|
3236
|
-
const SemVer = semver$1;
|
|
3237
|
-
const identifiers = identifiers$1;
|
|
3238
|
-
const parse = parse_1;
|
|
3239
|
-
const valid = valid_1;
|
|
3240
|
-
const clean = clean_1;
|
|
3241
|
-
const inc = inc_1;
|
|
3242
|
-
const diff = diff_1;
|
|
3243
|
-
const major = major_1;
|
|
3244
|
-
const minor = minor_1;
|
|
3245
|
-
const patch = patch_1;
|
|
3246
|
-
const prerelease = prerelease_1;
|
|
3247
|
-
const compare = compare_1;
|
|
3248
|
-
const rcompare = rcompare_1;
|
|
3249
|
-
const compareLoose = compareLoose_1;
|
|
3250
|
-
const compareBuild = compareBuild_1;
|
|
3251
|
-
const sort = sort_1;
|
|
3252
|
-
const rsort = rsort_1;
|
|
3253
|
-
const gt = gt_1;
|
|
3254
|
-
const lt = lt_1;
|
|
3255
|
-
const eq = eq_1;
|
|
3256
|
-
const neq = neq_1;
|
|
3257
|
-
const gte = gte_1;
|
|
3258
|
-
const lte = lte_1;
|
|
3259
|
-
const cmp = cmp_1;
|
|
3260
|
-
const coerce = coerce_1;
|
|
3261
|
-
const Comparator = comparator;
|
|
3262
|
-
const Range = range;
|
|
3263
|
-
const satisfies = satisfies_1;
|
|
3264
|
-
const toComparators = toComparators_1;
|
|
3265
|
-
const maxSatisfying = maxSatisfying_1;
|
|
3266
|
-
const minSatisfying = minSatisfying_1;
|
|
3267
|
-
const minVersion = minVersion_1;
|
|
3268
|
-
const validRange = valid$1;
|
|
3269
|
-
const outside = outside_1;
|
|
3270
|
-
const gtr = gtr_1;
|
|
3271
|
-
const ltr = ltr_1;
|
|
3272
|
-
const intersects = intersects_1;
|
|
3273
|
-
const simplifyRange = simplify;
|
|
3274
|
-
const subset = subset_1;
|
|
3275
|
-
var semver = {
|
|
3276
|
-
parse,
|
|
3277
|
-
valid,
|
|
3278
|
-
clean,
|
|
3279
|
-
inc,
|
|
3280
|
-
diff,
|
|
3281
|
-
major,
|
|
3282
|
-
minor,
|
|
3283
|
-
patch,
|
|
3284
|
-
prerelease,
|
|
3285
|
-
compare,
|
|
3286
|
-
rcompare,
|
|
3287
|
-
compareLoose,
|
|
3288
|
-
compareBuild,
|
|
3289
|
-
sort,
|
|
3290
|
-
rsort,
|
|
3291
|
-
gt,
|
|
3292
|
-
lt,
|
|
3293
|
-
eq,
|
|
3294
|
-
neq,
|
|
3295
|
-
gte,
|
|
3296
|
-
lte,
|
|
3297
|
-
cmp,
|
|
3298
|
-
coerce,
|
|
3299
|
-
Comparator,
|
|
3300
|
-
Range,
|
|
3301
|
-
satisfies,
|
|
3302
|
-
toComparators,
|
|
3303
|
-
maxSatisfying,
|
|
3304
|
-
minSatisfying,
|
|
3305
|
-
minVersion,
|
|
3306
|
-
validRange,
|
|
3307
|
-
outside,
|
|
3308
|
-
gtr,
|
|
3309
|
-
ltr,
|
|
3310
|
-
intersects,
|
|
3311
|
-
simplifyRange,
|
|
3312
|
-
subset,
|
|
3313
|
-
SemVer,
|
|
3314
|
-
re: internalRe.re,
|
|
3315
|
-
src: internalRe.src,
|
|
3316
|
-
tokens: internalRe.t,
|
|
3317
|
-
SEMVER_SPEC_VERSION: constants.SEMVER_SPEC_VERSION,
|
|
3318
|
-
compareIdentifiers: identifiers.compareIdentifiers,
|
|
3319
|
-
rcompareIdentifiers: identifiers.rcompareIdentifiers,
|
|
3320
|
-
};
|
|
2605
|
+
var satisfies_1 = satisfies;
|
|
3321
2606
|
|
|
3322
2607
|
function checkVersion(threshold, version) {
|
|
3323
2608
|
if (!version)
|
|
3324
2609
|
return false;
|
|
3325
|
-
const parsedVersion =
|
|
2610
|
+
const parsedVersion = coerce_1(version);
|
|
3326
2611
|
if (parsedVersion === null)
|
|
3327
2612
|
return false;
|
|
3328
|
-
return
|
|
2613
|
+
return satisfies_1(parsedVersion, threshold);
|
|
3329
2614
|
}
|
|
3330
2615
|
|
|
3331
2616
|
function findArgument(args, name) {
|