ioredis-mock
Version:
This library emulates ioredis by performing all operations in-memory.
1,033 lines (1,000 loc) • 260 kB
JavaScript
var __create = Object.create;
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __getProtoOf = Object.getPrototypeOf, __hasOwnProp = Object.prototype.hasOwnProperty;
var __commonJS = (cb, mod) => function() {
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
};
var __export = (target, all) => {
for (var name in all)
__defProp(target, name, { get: all[name], enumerable: !0 });
}, __copyProps = (to, from, except, desc) => {
if (from && typeof from == "object" || typeof from == "function")
for (let key of __getOwnPropNames(from))
!__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
return to;
};
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
// If the importer is in node compatibility mode or this is not an ESM
// file that has been converted to a CommonJS file using a Babel-
// compatible transform (i.e. "__esModule" has not been set), then set
// "default" to the CommonJS "module.exports" for node compatibility.
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: !0 }) : target,
mod
));
// node_modules/lodash.shuffle/index.js
var require_lodash = __commonJS({
"node_modules/lodash.shuffle/index.js"(exports2, module2) {
var INFINITY = 1 / 0, MAX_SAFE_INTEGER = 9007199254740991, MAX_INTEGER = 17976931348623157e292, NAN = NaN, MAX_ARRAY_LENGTH = 4294967295, argsTag = "[object Arguments]", funcTag = "[object Function]", genTag = "[object GeneratorFunction]", mapTag = "[object Map]", objectTag = "[object Object]", promiseTag = "[object Promise]", setTag = "[object Set]", stringTag = "[object String]", symbolTag = "[object Symbol]", weakMapTag = "[object WeakMap]", dataViewTag = "[object DataView]", reRegExpChar = /[\\^$.*+?()[\]{}|]/g, reTrim = /^\s+|\s+$/g, reIsBadHex = /^[-+]0x[0-9a-f]+$/i, reIsBinary = /^0b[01]+$/i, reIsHostCtor = /^\[object .+?Constructor\]$/, reIsOctal = /^0o[0-7]+$/i, reIsUint = /^(?:0|[1-9]\d*)$/, rsAstralRange = "\\ud800-\\udfff", rsComboMarksRange = "\\u0300-\\u036f\\ufe20-\\ufe23", rsComboSymbolsRange = "\\u20d0-\\u20f0", rsVarRange = "\\ufe0e\\ufe0f", rsAstral = "[" + rsAstralRange + "]", rsCombo = "[" + rsComboMarksRange + rsComboSymbolsRange + "]", rsFitz = "\\ud83c[\\udffb-\\udfff]", rsModifier = "(?:" + rsCombo + "|" + rsFitz + ")", rsNonAstral = "[^" + rsAstralRange + "]", rsRegional = "(?:\\ud83c[\\udde6-\\uddff]){2}", rsSurrPair = "[\\ud800-\\udbff][\\udc00-\\udfff]", rsZWJ = "\\u200d", reOptMod = rsModifier + "?", rsOptVar = "[" + rsVarRange + "]?", rsOptJoin = "(?:" + rsZWJ + "(?:" + [rsNonAstral, rsRegional, rsSurrPair].join("|") + ")" + rsOptVar + reOptMod + ")*", rsSeq = rsOptVar + reOptMod + rsOptJoin, rsSymbol = "(?:" + [rsNonAstral + rsCombo + "?", rsCombo, rsRegional, rsSurrPair, rsAstral].join("|") + ")", reUnicode = RegExp(rsFitz + "(?=" + rsFitz + ")|" + rsSymbol + rsSeq, "g"), reHasUnicode = RegExp("[" + rsZWJ + rsAstralRange + rsComboMarksRange + rsComboSymbolsRange + rsVarRange + "]"), freeParseInt = parseInt, freeGlobal = typeof global == "object" && global && global.Object === Object && global, freeSelf = typeof self == "object" && self && self.Object === Object && self, root = freeGlobal || freeSelf || Function("return this")();
function arrayMap(array, iteratee) {
for (var index = -1, length = array ? array.length : 0, result = Array(length); ++index < length; )
result[index] = iteratee(array[index], index, array);
return result;
}
function asciiToArray(string) {
return string.split("");
}
function baseTimes(n, iteratee) {
for (var index = -1, result = Array(n); ++index < n; )
result[index] = iteratee(index);
return result;
}
function baseValues(object2, props) {
return arrayMap(props, function(key) {
return object2[key];
});
}
function getValue(object2, key) {
return object2 == null ? void 0 : object2[key];
}
function hasUnicode(string) {
return reHasUnicode.test(string);
}
function isHostObject(value) {
var result = !1;
if (value != null && typeof value.toString != "function")
try {
result = !!(value + "");
} catch {
}
return result;
}
function iteratorToArray(iterator) {
for (var data, result = []; !(data = iterator.next()).done; )
result.push(data.value);
return result;
}
function mapToArray(map) {
var index = -1, result = Array(map.size);
return map.forEach(function(value, key) {
result[++index] = [key, value];
}), result;
}
function overArg(func, transform) {
return function(arg) {
return func(transform(arg));
};
}
function setToArray(set2) {
var index = -1, result = Array(set2.size);
return set2.forEach(function(value) {
result[++index] = value;
}), result;
}
function stringToArray(string) {
return hasUnicode(string) ? unicodeToArray(string) : asciiToArray(string);
}
function unicodeToArray(string) {
return string.match(reUnicode) || [];
}
var funcProto = Function.prototype, objectProto = Object.prototype, coreJsData = root["__core-js_shared__"], maskSrcKey = (function() {
var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || "");
return uid ? "Symbol(src)_1." + uid : "";
})(), funcToString = funcProto.toString, hasOwnProperty = objectProto.hasOwnProperty, objectToString = objectProto.toString, reIsNative = RegExp(
"^" + funcToString.call(hasOwnProperty).replace(reRegExpChar, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$"
), Symbol2 = root.Symbol, iteratorSymbol = Symbol2 ? Symbol2.iterator : void 0, propertyIsEnumerable = objectProto.propertyIsEnumerable, nativeFloor = Math.floor, nativeKeys = overArg(Object.keys, Object), nativeRandom = Math.random, DataView = getNative(root, "DataView"), Map2 = getNative(root, "Map"), Promise2 = getNative(root, "Promise"), Set2 = getNative(root, "Set"), WeakMap = getNative(root, "WeakMap"), dataViewCtorString = toSource(DataView), mapCtorString = toSource(Map2), promiseCtorString = toSource(Promise2), setCtorString = toSource(Set2), weakMapCtorString = toSource(WeakMap);
function arrayLikeKeys(value, inherited) {
var result = isArray(value) || isArguments(value) ? baseTimes(value.length, String) : [], length = result.length, skipIndexes = !!length;
for (var key in value)
(inherited || hasOwnProperty.call(value, key)) && !(skipIndexes && (key == "length" || isIndex(key, length))) && result.push(key);
return result;
}
function baseClamp(number, lower, upper) {
return number === number && (upper !== void 0 && (number = number <= upper ? number : upper), lower !== void 0 && (number = number >= lower ? number : lower)), number;
}
function baseGetTag(value) {
return objectToString.call(value);
}
function baseIsNative(value) {
if (!isObject(value) || isMasked(value))
return !1;
var pattern2 = isFunction(value) || isHostObject(value) ? reIsNative : reIsHostCtor;
return pattern2.test(toSource(value));
}
function baseKeys(object2) {
if (!isPrototype(object2))
return nativeKeys(object2);
var result = [];
for (var key in Object(object2))
hasOwnProperty.call(object2, key) && key != "constructor" && result.push(key);
return result;
}
function baseRandom(lower, upper) {
return lower + nativeFloor(nativeRandom() * (upper - lower + 1));
}
function copyArray(source, array) {
var index = -1, length = source.length;
for (array || (array = Array(length)); ++index < length; )
array[index] = source[index];
return array;
}
function getNative(object2, key) {
var value = getValue(object2, key);
return baseIsNative(value) ? value : void 0;
}
var getTag = baseGetTag;
(DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag || Map2 && getTag(new Map2()) != mapTag || Promise2 && getTag(Promise2.resolve()) != promiseTag || Set2 && getTag(new Set2()) != setTag || WeakMap && getTag(new WeakMap()) != weakMapTag) && (getTag = function(value) {
var result = objectToString.call(value), Ctor = result == objectTag ? value.constructor : void 0, ctorString = Ctor ? toSource(Ctor) : void 0;
if (ctorString)
switch (ctorString) {
case dataViewCtorString:
return dataViewTag;
case mapCtorString:
return mapTag;
case promiseCtorString:
return promiseTag;
case setCtorString:
return setTag;
case weakMapCtorString:
return weakMapTag;
}
return result;
});
function isIndex(value, length) {
return length = length == null ? MAX_SAFE_INTEGER : length, !!length && (typeof value == "number" || reIsUint.test(value)) && value > -1 && value % 1 == 0 && value < length;
}
function isIterateeCall(value, index, object2) {
if (!isObject(object2))
return !1;
var type2 = typeof index;
return (type2 == "number" ? isArrayLike(object2) && isIndex(index, object2.length) : type2 == "string" && index in object2) ? eq(object2[index], value) : !1;
}
function isMasked(func) {
return !!maskSrcKey && maskSrcKey in func;
}
function isPrototype(value) {
var Ctor = value && value.constructor, proto = typeof Ctor == "function" && Ctor.prototype || objectProto;
return value === proto;
}
function toSource(func) {
if (func != null) {
try {
return funcToString.call(func);
} catch {
}
try {
return func + "";
} catch {
}
}
return "";
}
function sampleSize(collection, n, guard) {
var index = -1, result = toArray(collection), length = result.length, lastIndex = length - 1;
for ((guard ? isIterateeCall(collection, n, guard) : n === void 0) ? n = 1 : n = baseClamp(toInteger(n), 0, length); ++index < n; ) {
var rand = baseRandom(index, lastIndex), value = result[rand];
result[rand] = result[index], result[index] = value;
}
return result.length = n, result;
}
function shuffle4(collection) {
return sampleSize(collection, MAX_ARRAY_LENGTH);
}
function eq(value, other) {
return value === other || value !== value && other !== other;
}
function isArguments(value) {
return isArrayLikeObject(value) && hasOwnProperty.call(value, "callee") && (!propertyIsEnumerable.call(value, "callee") || objectToString.call(value) == argsTag);
}
var isArray = Array.isArray;
function isArrayLike(value) {
return value != null && isLength(value.length) && !isFunction(value);
}
function isArrayLikeObject(value) {
return isObjectLike(value) && isArrayLike(value);
}
function isFunction(value) {
var tag = isObject(value) ? objectToString.call(value) : "";
return tag == funcTag || tag == genTag;
}
function isLength(value) {
return typeof value == "number" && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
}
function isObject(value) {
var type2 = typeof value;
return !!value && (type2 == "object" || type2 == "function");
}
function isObjectLike(value) {
return !!value && typeof value == "object";
}
function isString2(value) {
return typeof value == "string" || !isArray(value) && isObjectLike(value) && objectToString.call(value) == stringTag;
}
function isSymbol(value) {
return typeof value == "symbol" || isObjectLike(value) && objectToString.call(value) == symbolTag;
}
function toArray(value) {
if (!value)
return [];
if (isArrayLike(value))
return isString2(value) ? stringToArray(value) : copyArray(value);
if (iteratorSymbol && value[iteratorSymbol])
return iteratorToArray(value[iteratorSymbol]());
var tag = getTag(value), func = tag == mapTag ? mapToArray : tag == setTag ? setToArray : values;
return func(value);
}
function toFinite(value) {
if (!value)
return value === 0 ? value : 0;
if (value = toNumber(value), value === INFINITY || value === -INFINITY) {
var sign = value < 0 ? -1 : 1;
return sign * MAX_INTEGER;
}
return value === value ? value : 0;
}
function toInteger(value) {
var result = toFinite(value), remainder = result % 1;
return result === result ? remainder ? result - remainder : result : 0;
}
function toNumber(value) {
if (typeof value == "number")
return value;
if (isSymbol(value))
return NAN;
if (isObject(value)) {
var other = typeof value.valueOf == "function" ? value.valueOf() : value;
value = isObject(other) ? other + "" : other;
}
if (typeof value != "string")
return value === 0 ? value : +value;
value = value.replace(reTrim, "");
var isBinary = reIsBinary.test(value);
return isBinary || reIsOctal.test(value) ? freeParseInt(value.slice(2), isBinary ? 2 : 8) : reIsBadHex.test(value) ? NAN : +value;
}
function keys2(object2) {
return isArrayLike(object2) ? arrayLikeKeys(object2) : baseKeys(object2);
}
function values(object2) {
return object2 ? baseValues(object2, keys2(object2)) : [];
}
module2.exports = shuffle4;
}
});
// node_modules/semver/internal/constants.js
var require_constants = __commonJS({
"node_modules/semver/internal/constants.js"(exports2, module2) {
"use strict";
var SEMVER_SPEC_VERSION = "2.0.0", MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER || /* istanbul ignore next */
9007199254740991, MAX_SAFE_COMPONENT_LENGTH = 16, MAX_SAFE_BUILD_LENGTH = 250, RELEASE_TYPES = [
"major",
"premajor",
"minor",
"preminor",
"patch",
"prepatch",
"prerelease"
];
module2.exports = {
MAX_LENGTH: 256,
MAX_SAFE_COMPONENT_LENGTH,
MAX_SAFE_BUILD_LENGTH,
MAX_SAFE_INTEGER,
RELEASE_TYPES,
SEMVER_SPEC_VERSION,
FLAG_INCLUDE_PRERELEASE: 1,
FLAG_LOOSE: 2
};
}
});
// node_modules/semver/internal/debug.js
var require_debug = __commonJS({
"node_modules/semver/internal/debug.js"(exports2, module2) {
"use strict";
var debug = typeof process == "object" && process.env && process.env.NODE_DEBUG && /\bsemver\b/i.test(process.env.NODE_DEBUG) ? (...args) => console.error("SEMVER", ...args) : () => {
};
module2.exports = debug;
}
});
// node_modules/semver/internal/re.js
var require_re = __commonJS({
"node_modules/semver/internal/re.js"(exports2, module2) {
"use strict";
var {
MAX_SAFE_COMPONENT_LENGTH,
MAX_SAFE_BUILD_LENGTH,
MAX_LENGTH
} = require_constants(), debug = require_debug();
exports2 = module2.exports = {};
var re = exports2.re = [], safeRe = exports2.safeRe = [], src = exports2.src = [], safeSrc = exports2.safeSrc = [], t = exports2.t = {}, R = 0, LETTERDASHNUMBER = "[a-zA-Z0-9-]", safeRegexReplacements = [
["\\s", 1],
["\\d", MAX_LENGTH],
[LETTERDASHNUMBER, MAX_SAFE_BUILD_LENGTH]
], makeSafeRegex = (value) => {
for (let [token, max] of safeRegexReplacements)
value = value.split(`${token}*`).join(`${token}{0,${max}}`).split(`${token}+`).join(`${token}{1,${max}}`);
return value;
}, createToken = (name, value, isGlobal) => {
let safe = makeSafeRegex(value), index = R++;
debug(name, index, value), t[name] = index, src[index] = value, safeSrc[index] = safe, re[index] = new RegExp(value, isGlobal ? "g" : void 0), safeRe[index] = new RegExp(safe, isGlobal ? "g" : void 0);
};
createToken("NUMERICIDENTIFIER", "0|[1-9]\\d*");
createToken("NUMERICIDENTIFIERLOOSE", "\\d+");
createToken("NONNUMERICIDENTIFIER", `\\d*[a-zA-Z-]${LETTERDASHNUMBER}*`);
createToken("MAINVERSION", `(${src[t.NUMERICIDENTIFIER]})\\.(${src[t.NUMERICIDENTIFIER]})\\.(${src[t.NUMERICIDENTIFIER]})`);
createToken("MAINVERSIONLOOSE", `(${src[t.NUMERICIDENTIFIERLOOSE]})\\.(${src[t.NUMERICIDENTIFIERLOOSE]})\\.(${src[t.NUMERICIDENTIFIERLOOSE]})`);
createToken("PRERELEASEIDENTIFIER", `(?:${src[t.NONNUMERICIDENTIFIER]}|${src[t.NUMERICIDENTIFIER]})`);
createToken("PRERELEASEIDENTIFIERLOOSE", `(?:${src[t.NONNUMERICIDENTIFIER]}|${src[t.NUMERICIDENTIFIERLOOSE]})`);
createToken("PRERELEASE", `(?:-(${src[t.PRERELEASEIDENTIFIER]}(?:\\.${src[t.PRERELEASEIDENTIFIER]})*))`);
createToken("PRERELEASELOOSE", `(?:-?(${src[t.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${src[t.PRERELEASEIDENTIFIERLOOSE]})*))`);
createToken("BUILDIDENTIFIER", `${LETTERDASHNUMBER}+`);
createToken("BUILD", `(?:\\+(${src[t.BUILDIDENTIFIER]}(?:\\.${src[t.BUILDIDENTIFIER]})*))`);
createToken("FULLPLAIN", `v?${src[t.MAINVERSION]}${src[t.PRERELEASE]}?${src[t.BUILD]}?`);
createToken("FULL", `^${src[t.FULLPLAIN]}$`);
createToken("LOOSEPLAIN", `[v=\\s]*${src[t.MAINVERSIONLOOSE]}${src[t.PRERELEASELOOSE]}?${src[t.BUILD]}?`);
createToken("LOOSE", `^${src[t.LOOSEPLAIN]}$`);
createToken("GTLT", "((?:<|>)?=?)");
createToken("XRANGEIDENTIFIERLOOSE", `${src[t.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);
createToken("XRANGEIDENTIFIER", `${src[t.NUMERICIDENTIFIER]}|x|X|\\*`);
createToken("XRANGEPLAIN", `[v=\\s]*(${src[t.XRANGEIDENTIFIER]})(?:\\.(${src[t.XRANGEIDENTIFIER]})(?:\\.(${src[t.XRANGEIDENTIFIER]})(?:${src[t.PRERELEASE]})?${src[t.BUILD]}?)?)?`);
createToken("XRANGEPLAINLOOSE", `[v=\\s]*(${src[t.XRANGEIDENTIFIERLOOSE]})(?:\\.(${src[t.XRANGEIDENTIFIERLOOSE]})(?:\\.(${src[t.XRANGEIDENTIFIERLOOSE]})(?:${src[t.PRERELEASELOOSE]})?${src[t.BUILD]}?)?)?`);
createToken("XRANGE", `^${src[t.GTLT]}\\s*${src[t.XRANGEPLAIN]}$`);
createToken("XRANGELOOSE", `^${src[t.GTLT]}\\s*${src[t.XRANGEPLAINLOOSE]}$`);
createToken("COERCEPLAIN", `(^|[^\\d])(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}})(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?`);
createToken("COERCE", `${src[t.COERCEPLAIN]}(?:$|[^\\d])`);
createToken("COERCEFULL", src[t.COERCEPLAIN] + `(?:${src[t.PRERELEASE]})?(?:${src[t.BUILD]})?(?:$|[^\\d])`);
createToken("COERCERTL", src[t.COERCE], !0);
createToken("COERCERTLFULL", src[t.COERCEFULL], !0);
createToken("LONETILDE", "(?:~>?)");
createToken("TILDETRIM", `(\\s*)${src[t.LONETILDE]}\\s+`, !0);
exports2.tildeTrimReplace = "$1~";
createToken("TILDE", `^${src[t.LONETILDE]}${src[t.XRANGEPLAIN]}$`);
createToken("TILDELOOSE", `^${src[t.LONETILDE]}${src[t.XRANGEPLAINLOOSE]}$`);
createToken("LONECARET", "(?:\\^)");
createToken("CARETTRIM", `(\\s*)${src[t.LONECARET]}\\s+`, !0);
exports2.caretTrimReplace = "$1^";
createToken("CARET", `^${src[t.LONECARET]}${src[t.XRANGEPLAIN]}$`);
createToken("CARETLOOSE", `^${src[t.LONECARET]}${src[t.XRANGEPLAINLOOSE]}$`);
createToken("COMPARATORLOOSE", `^${src[t.GTLT]}\\s*(${src[t.LOOSEPLAIN]})$|^$`);
createToken("COMPARATOR", `^${src[t.GTLT]}\\s*(${src[t.FULLPLAIN]})$|^$`);
createToken("COMPARATORTRIM", `(\\s*)${src[t.GTLT]}\\s*(${src[t.LOOSEPLAIN]}|${src[t.XRANGEPLAIN]})`, !0);
exports2.comparatorTrimReplace = "$1$2$3";
createToken("HYPHENRANGE", `^\\s*(${src[t.XRANGEPLAIN]})\\s+-\\s+(${src[t.XRANGEPLAIN]})\\s*$`);
createToken("HYPHENRANGELOOSE", `^\\s*(${src[t.XRANGEPLAINLOOSE]})\\s+-\\s+(${src[t.XRANGEPLAINLOOSE]})\\s*$`);
createToken("STAR", "(<|>)?=?\\s*\\*");
createToken("GTE0", "^\\s*>=\\s*0\\.0\\.0\\s*$");
createToken("GTE0PRE", "^\\s*>=\\s*0\\.0\\.0-0\\s*$");
}
});
// node_modules/semver/internal/parse-options.js
var require_parse_options = __commonJS({
"node_modules/semver/internal/parse-options.js"(exports2, module2) {
"use strict";
var looseOption = Object.freeze({ loose: !0 }), emptyOpts = Object.freeze({}), parseOptions = (options) => options ? typeof options != "object" ? looseOption : options : emptyOpts;
module2.exports = parseOptions;
}
});
// node_modules/semver/internal/identifiers.js
var require_identifiers = __commonJS({
"node_modules/semver/internal/identifiers.js"(exports2, module2) {
"use strict";
var numeric = /^[0-9]+$/, compareIdentifiers = (a, b) => {
let anum = numeric.test(a), bnum = numeric.test(b);
return anum && bnum && (a = +a, b = +b), a === b ? 0 : anum && !bnum ? -1 : bnum && !anum ? 1 : a < b ? -1 : 1;
}, rcompareIdentifiers = (a, b) => compareIdentifiers(b, a);
module2.exports = {
compareIdentifiers,
rcompareIdentifiers
};
}
});
// node_modules/semver/classes/semver.js
var require_semver = __commonJS({
"node_modules/semver/classes/semver.js"(exports2, module2) {
"use strict";
var debug = require_debug(), { MAX_LENGTH, MAX_SAFE_INTEGER } = require_constants(), { safeRe: re, t } = require_re(), parseOptions = require_parse_options(), { compareIdentifiers } = require_identifiers(), SemVer = class _SemVer {
constructor(version, options) {
if (options = parseOptions(options), version instanceof _SemVer) {
if (version.loose === !!options.loose && version.includePrerelease === !!options.includePrerelease)
return version;
version = version.version;
} else if (typeof version != "string")
throw new TypeError(`Invalid version. Must be a string. Got type "${typeof version}".`);
if (version.length > MAX_LENGTH)
throw new TypeError(
`version is longer than ${MAX_LENGTH} characters`
);
debug("SemVer", version, options), this.options = options, this.loose = !!options.loose, this.includePrerelease = !!options.includePrerelease;
let m = version.trim().match(options.loose ? re[t.LOOSE] : re[t.FULL]);
if (!m)
throw new TypeError(`Invalid Version: ${version}`);
if (this.raw = version, this.major = +m[1], this.minor = +m[2], this.patch = +m[3], this.major > MAX_SAFE_INTEGER || this.major < 0)
throw new TypeError("Invalid major version");
if (this.minor > MAX_SAFE_INTEGER || this.minor < 0)
throw new TypeError("Invalid minor version");
if (this.patch > MAX_SAFE_INTEGER || this.patch < 0)
throw new TypeError("Invalid patch version");
m[4] ? this.prerelease = m[4].split(".").map((id) => {
if (/^[0-9]+$/.test(id)) {
let num = +id;
if (num >= 0 && num < MAX_SAFE_INTEGER)
return num;
}
return id;
}) : this.prerelease = [], this.build = m[5] ? m[5].split(".") : [], this.format();
}
format() {
return this.version = `${this.major}.${this.minor}.${this.patch}`, this.prerelease.length && (this.version += `-${this.prerelease.join(".")}`), this.version;
}
toString() {
return this.version;
}
compare(other) {
if (debug("SemVer.compare", this.version, this.options, other), !(other instanceof _SemVer)) {
if (typeof other == "string" && other === this.version)
return 0;
other = new _SemVer(other, this.options);
}
return other.version === this.version ? 0 : this.compareMain(other) || this.comparePre(other);
}
compareMain(other) {
return other instanceof _SemVer || (other = new _SemVer(other, this.options)), compareIdentifiers(this.major, other.major) || compareIdentifiers(this.minor, other.minor) || compareIdentifiers(this.patch, other.patch);
}
comparePre(other) {
if (other instanceof _SemVer || (other = new _SemVer(other, this.options)), this.prerelease.length && !other.prerelease.length)
return -1;
if (!this.prerelease.length && other.prerelease.length)
return 1;
if (!this.prerelease.length && !other.prerelease.length)
return 0;
let i = 0;
do {
let a = this.prerelease[i], b = other.prerelease[i];
if (debug("prerelease compare", i, a, b), a === void 0 && b === void 0)
return 0;
if (b === void 0)
return 1;
if (a === void 0)
return -1;
if (a === b)
continue;
return compareIdentifiers(a, b);
} while (++i);
}
compareBuild(other) {
other instanceof _SemVer || (other = new _SemVer(other, this.options));
let i = 0;
do {
let a = this.build[i], b = other.build[i];
if (debug("build compare", i, a, b), a === void 0 && b === void 0)
return 0;
if (b === void 0)
return 1;
if (a === void 0)
return -1;
if (a === b)
continue;
return compareIdentifiers(a, b);
} while (++i);
}
// preminor will bump the version up to the next minor release, and immediately
// down to pre-release. premajor and prepatch work the same way.
inc(release, identifier, identifierBase) {
if (release.startsWith("pre")) {
if (!identifier && identifierBase === !1)
throw new Error("invalid increment argument: identifier is empty");
if (identifier) {
let match = `-${identifier}`.match(this.options.loose ? re[t.PRERELEASELOOSE] : re[t.PRERELEASE]);
if (!match || match[1] !== identifier)
throw new Error(`invalid identifier: ${identifier}`);
}
}
switch (release) {
case "premajor":
this.prerelease.length = 0, this.patch = 0, this.minor = 0, this.major++, this.inc("pre", identifier, identifierBase);
break;
case "preminor":
this.prerelease.length = 0, this.patch = 0, this.minor++, this.inc("pre", identifier, identifierBase);
break;
case "prepatch":
this.prerelease.length = 0, this.inc("patch", identifier, identifierBase), this.inc("pre", identifier, identifierBase);
break;
// If the input is a non-prerelease version, this acts the same as
// prepatch.
case "prerelease":
this.prerelease.length === 0 && this.inc("patch", identifier, identifierBase), this.inc("pre", identifier, identifierBase);
break;
case "release":
if (this.prerelease.length === 0)
throw new Error(`version ${this.raw} is not a prerelease`);
this.prerelease.length = 0;
break;
case "major":
(this.minor !== 0 || this.patch !== 0 || this.prerelease.length === 0) && this.major++, this.minor = 0, this.patch = 0, this.prerelease = [];
break;
case "minor":
(this.patch !== 0 || this.prerelease.length === 0) && this.minor++, this.patch = 0, this.prerelease = [];
break;
case "patch":
this.prerelease.length === 0 && this.patch++, this.prerelease = [];
break;
// This probably shouldn't be used publicly.
// 1.0.0 'pre' would become 1.0.0-0 which is the wrong direction.
case "pre": {
let base = Number(identifierBase) ? 1 : 0;
if (this.prerelease.length === 0)
this.prerelease = [base];
else {
let i = this.prerelease.length;
for (; --i >= 0; )
typeof this.prerelease[i] == "number" && (this.prerelease[i]++, i = -2);
if (i === -1) {
if (identifier === this.prerelease.join(".") && identifierBase === !1)
throw new Error("invalid increment argument: identifier already exists");
this.prerelease.push(base);
}
}
if (identifier) {
let prerelease = [identifier, base];
identifierBase === !1 && (prerelease = [identifier]), compareIdentifiers(this.prerelease[0], identifier) === 0 ? isNaN(this.prerelease[1]) && (this.prerelease = prerelease) : this.prerelease = prerelease;
}
break;
}
default:
throw new Error(`invalid increment argument: ${release}`);
}
return this.raw = this.format(), this.build.length && (this.raw += `+${this.build.join(".")}`), this;
}
};
module2.exports = SemVer;
}
});
// node_modules/semver/functions/parse.js
var require_parse = __commonJS({
"node_modules/semver/functions/parse.js"(exports2, module2) {
"use strict";
var SemVer = require_semver(), parse = (version, options, throwErrors = !1) => {
if (version instanceof SemVer)
return version;
try {
return new SemVer(version, options);
} catch (er) {
if (!throwErrors)
return null;
throw er;
}
};
module2.exports = parse;
}
});
// node_modules/semver/functions/valid.js
var require_valid = __commonJS({
"node_modules/semver/functions/valid.js"(exports2, module2) {
"use strict";
var parse = require_parse(), valid = (version, options) => {
let v = parse(version, options);
return v ? v.version : null;
};
module2.exports = valid;
}
});
// node_modules/semver/functions/clean.js
var require_clean = __commonJS({
"node_modules/semver/functions/clean.js"(exports2, module2) {
"use strict";
var parse = require_parse(), clean = (version, options) => {
let s = parse(version.trim().replace(/^[=v]+/, ""), options);
return s ? s.version : null;
};
module2.exports = clean;
}
});
// node_modules/semver/functions/inc.js
var require_inc = __commonJS({
"node_modules/semver/functions/inc.js"(exports2, module2) {
"use strict";
var SemVer = require_semver(), inc = (version, release, options, identifier, identifierBase) => {
typeof options == "string" && (identifierBase = identifier, identifier = options, options = void 0);
try {
return new SemVer(
version instanceof SemVer ? version.version : version,
options
).inc(release, identifier, identifierBase).version;
} catch {
return null;
}
};
module2.exports = inc;
}
});
// node_modules/semver/functions/diff.js
var require_diff = __commonJS({
"node_modules/semver/functions/diff.js"(exports2, module2) {
"use strict";
var parse = require_parse(), diff = (version1, version2) => {
let v1 = parse(version1, null, !0), v2 = parse(version2, null, !0), comparison = v1.compare(v2);
if (comparison === 0)
return null;
let v1Higher = comparison > 0, highVersion = v1Higher ? v1 : v2, lowVersion = v1Higher ? v2 : v1, highHasPre = !!highVersion.prerelease.length;
if (!!lowVersion.prerelease.length && !highHasPre) {
if (!lowVersion.patch && !lowVersion.minor)
return "major";
if (lowVersion.compareMain(highVersion) === 0)
return lowVersion.minor && !lowVersion.patch ? "minor" : "patch";
}
let prefix = highHasPre ? "pre" : "";
return v1.major !== v2.major ? prefix + "major" : v1.minor !== v2.minor ? prefix + "minor" : v1.patch !== v2.patch ? prefix + "patch" : "prerelease";
};
module2.exports = diff;
}
});
// node_modules/semver/functions/major.js
var require_major = __commonJS({
"node_modules/semver/functions/major.js"(exports2, module2) {
"use strict";
var SemVer = require_semver(), major = (a, loose) => new SemVer(a, loose).major;
module2.exports = major;
}
});
// node_modules/semver/functions/minor.js
var require_minor = __commonJS({
"node_modules/semver/functions/minor.js"(exports2, module2) {
"use strict";
var SemVer = require_semver(), minor = (a, loose) => new SemVer(a, loose).minor;
module2.exports = minor;
}
});
// node_modules/semver/functions/patch.js
var require_patch = __commonJS({
"node_modules/semver/functions/patch.js"(exports2, module2) {
"use strict";
var SemVer = require_semver(), patch = (a, loose) => new SemVer(a, loose).patch;
module2.exports = patch;
}
});
// node_modules/semver/functions/prerelease.js
var require_prerelease = __commonJS({
"node_modules/semver/functions/prerelease.js"(exports2, module2) {
"use strict";
var parse = require_parse(), prerelease = (version, options) => {
let parsed = parse(version, options);
return parsed && parsed.prerelease.length ? parsed.prerelease : null;
};
module2.exports = prerelease;
}
});
// node_modules/semver/functions/compare.js
var require_compare = __commonJS({
"node_modules/semver/functions/compare.js"(exports2, module2) {
"use strict";
var SemVer = require_semver(), compare = (a, b, loose) => new SemVer(a, loose).compare(new SemVer(b, loose));
module2.exports = compare;
}
});
// node_modules/semver/functions/rcompare.js
var require_rcompare = __commonJS({
"node_modules/semver/functions/rcompare.js"(exports2, module2) {
"use strict";
var compare = require_compare(), rcompare = (a, b, loose) => compare(b, a, loose);
module2.exports = rcompare;
}
});
// node_modules/semver/functions/compare-loose.js
var require_compare_loose = __commonJS({
"node_modules/semver/functions/compare-loose.js"(exports2, module2) {
"use strict";
var compare = require_compare(), compareLoose = (a, b) => compare(a, b, !0);
module2.exports = compareLoose;
}
});
// node_modules/semver/functions/compare-build.js
var require_compare_build = __commonJS({
"node_modules/semver/functions/compare-build.js"(exports2, module2) {
"use strict";
var SemVer = require_semver(), compareBuild = (a, b, loose) => {
let versionA = new SemVer(a, loose), versionB = new SemVer(b, loose);
return versionA.compare(versionB) || versionA.compareBuild(versionB);
};
module2.exports = compareBuild;
}
});
// node_modules/semver/functions/sort.js
var require_sort = __commonJS({
"node_modules/semver/functions/sort.js"(exports2, module2) {
"use strict";
var compareBuild = require_compare_build(), sort = (list, loose) => list.sort((a, b) => compareBuild(a, b, loose));
module2.exports = sort;
}
});
// node_modules/semver/functions/rsort.js
var require_rsort = __commonJS({
"node_modules/semver/functions/rsort.js"(exports2, module2) {
"use strict";
var compareBuild = require_compare_build(), rsort = (list, loose) => list.sort((a, b) => compareBuild(b, a, loose));
module2.exports = rsort;
}
});
// node_modules/semver/functions/gt.js
var require_gt = __commonJS({
"node_modules/semver/functions/gt.js"(exports2, module2) {
"use strict";
var compare = require_compare(), gt = (a, b, loose) => compare(a, b, loose) > 0;
module2.exports = gt;
}
});
// node_modules/semver/functions/lt.js
var require_lt = __commonJS({
"node_modules/semver/functions/lt.js"(exports2, module2) {
"use strict";
var compare = require_compare(), lt = (a, b, loose) => compare(a, b, loose) < 0;
module2.exports = lt;
}
});
// node_modules/semver/functions/eq.js
var require_eq = __commonJS({
"node_modules/semver/functions/eq.js"(exports2, module2) {
"use strict";
var compare = require_compare(), eq = (a, b, loose) => compare(a, b, loose) === 0;
module2.exports = eq;
}
});
// node_modules/semver/functions/neq.js
var require_neq = __commonJS({
"node_modules/semver/functions/neq.js"(exports2, module2) {
"use strict";
var compare = require_compare(), neq = (a, b, loose) => compare(a, b, loose) !== 0;
module2.exports = neq;
}
});
// node_modules/semver/functions/gte.js
var require_gte = __commonJS({
"node_modules/semver/functions/gte.js"(exports2, module2) {
"use strict";
var compare = require_compare(), gte = (a, b, loose) => compare(a, b, loose) >= 0;
module2.exports = gte;
}
});
// node_modules/semver/functions/lte.js
var require_lte = __commonJS({
"node_modules/semver/functions/lte.js"(exports2, module2) {
"use strict";
var compare = require_compare(), lte = (a, b, loose) => compare(a, b, loose) <= 0;
module2.exports = lte;
}
});
// node_modules/semver/functions/cmp.js
var require_cmp = __commonJS({
"node_modules/semver/functions/cmp.js"(exports2, module2) {
"use strict";
var eq = require_eq(), neq = require_neq(), gt = require_gt(), gte = require_gte(), lt = require_lt(), lte = require_lte(), cmp = (a, op, b, loose) => {
switch (op) {
case "===":
return typeof a == "object" && (a = a.version), typeof b == "object" && (b = b.version), a === b;
case "!==":
return typeof a == "object" && (a = a.version), typeof b == "object" && (b = b.version), a !== b;
case "":
case "=":
case "==":
return eq(a, b, loose);
case "!=":
return neq(a, b, loose);
case ">":
return gt(a, b, loose);
case ">=":
return gte(a, b, loose);
case "<":
return lt(a, b, loose);
case "<=":
return lte(a, b, loose);
default:
throw new TypeError(`Invalid operator: ${op}`);
}
};
module2.exports = cmp;
}
});
// node_modules/semver/functions/coerce.js
var require_coerce = __commonJS({
"node_modules/semver/functions/coerce.js"(exports2, module2) {
"use strict";
var SemVer = require_semver(), parse = require_parse(), { safeRe: re, t } = require_re(), coerce2 = (version, options) => {
if (version instanceof SemVer)
return version;
if (typeof version == "number" && (version = String(version)), typeof version != "string")
return null;
options = options || {};
let match = null;
if (!options.rtl)
match = version.match(options.includePrerelease ? re[t.COERCEFULL] : re[t.COERCE]);
else {
let coerceRtlRegex = options.includePrerelease ? re[t.COERCERTLFULL] : re[t.COERCERTL], next;
for (; (next = coerceRtlRegex.exec(version)) && (!match || match.index + match[0].length !== version.length); )
(!match || next.index + next[0].length !== match.index + match[0].length) && (match = next), coerceRtlRegex.lastIndex = next.index + next[1].length + next[2].length;
coerceRtlRegex.lastIndex = -1;
}
if (match === null)
return null;
let major = match[2], minor = match[3] || "0", patch = match[4] || "0", prerelease = options.includePrerelease && match[5] ? `-${match[5]}` : "", build = options.includePrerelease && match[6] ? `+${match[6]}` : "";
return parse(`${major}.${minor}.${patch}${prerelease}${build}`, options);
};
module2.exports = coerce2;
}
});
// node_modules/semver/internal/lrucache.js
var require_lrucache = __commonJS({
"node_modules/semver/internal/lrucache.js"(exports2, module2) {
"use strict";
var LRUCache = class {
constructor() {
this.max = 1e3, this.map = /* @__PURE__ */ new Map();
}
get(key) {
let value = this.map.get(key);
if (value !== void 0)
return this.map.delete(key), this.map.set(key, value), value;
}
delete(key) {
return this.map.delete(key);
}
set(key, value) {
if (!this.delete(key) && value !== void 0) {
if (this.map.size >= this.max) {
let firstKey = this.map.keys().next().value;
this.delete(firstKey);
}
this.map.set(key, value);
}
return this;
}
};
module2.exports = LRUCache;
}
});
// node_modules/semver/classes/range.js
var require_range = __commonJS({
"node_modules/semver/classes/range.js"(exports2, module2) {
"use strict";
var SPACE_CHARACTERS = /\s+/g, Range = class _Range {
constructor(range, options) {
if (options = parseOptions(options), range instanceof _Range)
return range.loose === !!options.loose && range.includePrerelease === !!options.includePrerelease ? range : new _Range(range.raw, options);
if (range instanceof Comparator)
return this.raw = range.value, this.set = [[range]], this.formatted = void 0, this;
if (this.options = options, this.loose = !!options.loose, this.includePrerelease = !!options.includePrerelease, this.raw = range.trim().replace(SPACE_CHARACTERS, " "), this.set = this.raw.split("||").map((r) => this.parseRange(r.trim())).filter((c) => c.length), !this.set.length)
throw new TypeError(`Invalid SemVer Range: ${this.raw}`);
if (this.set.length > 1) {
let first = this.set[0];
if (this.set = this.set.filter((c) => !isNullSet(c[0])), this.set.length === 0)
this.set = [first];
else if (this.set.length > 1) {
for (let c of this.set)
if (c.length === 1 && isAny(c[0])) {
this.set = [c];
break;
}
}
}
this.formatted = void 0;
}
get range() {
if (this.formatted === void 0) {
this.formatted = "";
for (let i = 0; i < this.set.length; i++) {
i > 0 && (this.formatted += "||");
let comps = this.set[i];
for (let k = 0; k < comps.length; k++)
k > 0 && (this.formatted += " "), this.formatted += comps[k].toString().trim();
}
}
return this.formatted;
}
format() {
return this.range;
}
toString() {
return this.range;
}
parseRange(range) {
let memoKey = ((this.options.includePrerelease && FLAG_INCLUDE_PRERELEASE) | (this.options.loose && FLAG_LOOSE)) + ":" + range, cached = cache.get(memoKey);
if (cached)
return cached;
let loose = this.options.loose, hr = loose ? re[t.HYPHENRANGELOOSE] : re[t.HYPHENRANGE];
range = range.replace(hr, hyphenReplace(this.options.includePrerelease)), debug("hyphen replace", range), range = range.replace(re[t.COMPARATORTRIM], comparatorTrimReplace), debug("comparator trim", range), range = range.replace(re[t.TILDETRIM], tildeTrimReplace), debug("tilde trim", range), range = range.replace(re[t.CARETTRIM], caretTrimReplace), debug("caret trim", range);
let rangeList = range.split(" ").map((comp) => parseComparator(comp, this.options)).join(" ").split(/\s+/).map((comp) => replaceGTE0(comp, this.options));
loose && (rangeList = rangeList.filter((comp) => (debug("loose invalid filter", comp, this.options), !!comp.match(re[t.COMPARATORLOOSE])))), debug("range list", rangeList);
let rangeMap = /* @__PURE__ */ new Map(), comparators = rangeList.map((comp) => new Comparator(comp, this.options));
for (let comp of comparators) {
if (isNullSet(comp))
return [comp];
rangeMap.set(comp.value, comp);
}
rangeMap.size > 1 && rangeMap.has("") && rangeMap.delete("");
let result = [...rangeMap.values()];
return cache.set(memoKey, result), result;
}
intersects(range, options) {
if (!(range instanceof _Range))
throw new TypeError("a Range is required");
return this.set.some((thisComparators) => isSatisfiable(thisComparators, options) && range.set.some((rangeComparators) => isSatisfiable(rangeComparators, options) && thisComparators.every((thisComparator) => rangeComparators.every((rangeComparator) => thisComparator.intersects(rangeComparator, options)))));
}
// if ANY of the sets match ALL of its comparators, then pass
test(version) {
if (!version)
return !1;
if (typeof version == "string")
try {
version = new SemVer(version, this.options);
} catch {
return !1;
}
for (let i = 0; i < this.set.length; i++)
if (testSet(this.set[i], version, this.options))
return !0;
return !1;
}
};
module2.exports = Range;
var LRU = require_lrucache(), cache = new LRU(), parseOptions = require_parse_options(), Comparator = require_comparator(), debug = require_debug(), SemVer = require_semver(), {
safeRe: re,
t,
comparatorTrimReplace,
tildeTrimReplace,
caretTrimReplace
} = require_re(), { FLAG_INCLUDE_PRERELEASE, FLAG_LOOSE } = require_constants(), isNullSet = (c) => c.value === "<0.0.0-0", isAny = (c) => c.value === "", isSatisfiable = (comparators, options) => {
let result = !0, remainingComparators = comparators.slice(), testComparator = remainingComparators.pop();
for (; result && remainingComparators.length; )
result = remainingComparators.every((otherComparator) => testComparator.intersects(otherComparator, options)), testComparator = remainingComparators.pop();
return result;
}, parseComparator = (comp, options) => (debug("comp", comp, options), comp = replaceCarets(comp, options), debug("caret", comp), comp = replaceTildes(comp, options), debug("tildes", comp), comp = replaceXRanges(comp, options), debug("xrange", comp), comp = replaceStars(comp, options), debug("stars", comp), comp), isX = (id) => !id || id.toLowerCase() === "x" || id === "*", replaceTildes = (comp, options) => comp.trim().split(/\s+/).map((c) => replaceTilde(c, options)).join(" "), replaceTilde = (comp, options) => {
let r = options.loose ? re[t.TILDELOOSE] : re[t.TILDE];
return comp.replace(r, (_, M, m, p, pr) => {
debug("tilde", comp, _, M, m, p, pr);
let ret;
return isX(M) ? ret = "" : isX(m) ? ret = `>=${M}.0.0 <${+M + 1}.0.0-0` : isX(p) ? ret = `>=${M}.${m}.0 <${M}.${+m + 1}.0-0` : pr ? (debug("replaceTilde pr", pr), ret = `>=${M}.${m}.${p}-${pr} <${M}.${+m + 1}.0-0`) : ret = `>=${M}.${m}.${p} <${M}.${+m + 1}.0-0`, debug("tilde return", ret), ret;
});
}, replaceCarets = (comp, options) => comp.trim().split(/\s+/).map((c) => replaceCaret(c, options)).join(" "), replaceCaret = (comp, options) => {
debug("caret", comp, options);
let r = options.loose ? re[t.CARETLOOSE] : re[t.CARET], z = options.includePrerelease ? "-0" : "";
return comp.replace(r, (_, M, m, p, pr) => {
debug("caret", comp, _, M, m, p, pr);
let ret;
return isX(M) ? ret = "" : isX(m) ? ret = `>=${M}.0.0${z} <${+M + 1}.0.0-0` : isX(p) ? M === "0" ? ret = `>=${M}.${m}.0${z} <${M}.${+m + 1}.0-0` : ret = `>=${M}.${m}.0${z} <${+M + 1}.0.0-0` : pr ? (debug("replaceCaret pr", pr), M === "0" ? m === "0" ? ret = `>=${M}.${m}.${p}-${pr} <${M}.${m}.${+p + 1}-0` : ret = `>=${M}.${m}.${p}-${pr} <${M}.${+m + 1}.0-0` : ret = `>=${M}.${m}.${p}-${pr} <${+M + 1}.0.0-0`) : (debug("no pr"), M === "0" ? m === "0" ? ret = `>=${M}.${m}.${p}${z} <${M}.${m}.${+p + 1}-0` : ret = `>=${M}.${m}.${p}${z} <${M}.${+m + 1}.0-0` : ret = `>=${M}.${m}.${p} <${+M + 1}.0.0-0`), debug("caret return", ret), ret;
});
}, replaceXRanges = (comp, options) => (debug("replaceXRanges", comp, options), comp.split(/\s+/).map((c) => replaceXRange(c, options)).join(" ")), replaceXRange = (comp, options) => {
comp = comp.trim();
let r = options.loose ? re[t.XRANGELOOSE] : re[t.XRANGE];
return comp.replace(r, (ret, gtlt, M, m, p, pr) => {
debug("xRange", comp, ret, gtlt, M, m, p, pr);
let xM = isX(M), xm = xM || isX(m), xp = xm || isX(p), anyX = xp;
return gtlt === "=" && anyX && (gtlt = ""), pr = options.includePrerelease ? "-0" : "", xM ? gtlt === ">" || gtlt === "<" ? ret = "<0.0.0-0" : ret = "*" : gtlt && anyX ? (xm && (m = 0), p = 0, gtlt === ">" ? (gtlt = ">=", xm ? (M = +M + 1, m = 0, p = 0) : (m = +m + 1, p = 0)) : gtlt === "<=" && (gtlt = "<", xm ? M = +M + 1 : m = +m + 1), gtlt === "<" && (pr = "-0"), ret = `${gtlt + M}.${m}.${p}${pr}`) : xm ? ret = `>=${M}.0.0${pr} <${+M + 1}.0.0-0` : xp && (ret = `>=${M}.${m}.0${pr} <${M}.${+m + 1}.0-0`), debug("xRange return", ret), ret;
});
}, replaceStars = (comp, options) => (debug("replaceStars", comp, options), comp.trim().replace(re[t.STAR], "")), replaceGTE0 = (comp, options) => (debug("replaceGTE0", comp, options), comp.trim().replace(re[options.includePrerelease ? t.GTE0PRE : t.GTE0], "")), hyphenReplace = (incPr) => ($0, from, fM, fm, fp, fpr, fb, to, tM, tm, tp, tpr) => (isX(fM) ? from = "" : isX(fm) ? from = `>=${fM}.0.0${incPr ? "-0" : ""}` : isX(fp) ? from = `>=${fM}.${fm}.0${incPr ? "-0" : ""}` : fpr ? from = `>=${from}` : from = `>=${from}${incPr ? "-0" : ""}`, isX(tM) ? to = "" : isX(tm) ? to = `<${+tM + 1}.0.0-0` : isX(tp) ? to = `<${tM}.${+tm + 1}.0-0` : tpr ? to = `<=${tM}.${tm}.${tp}-${tpr}` : incPr ? to = `<${tM}.${tm}.${+tp + 1}-0` : to = `<=${to}`, `${from} ${to}`.trim()), testSet = (set2, version, options) => {
for (let i = 0; i < set2.length; i++)
if (!set2[i].test(version))
return !1;
if (version.prerelease.length && !options.includePrerelease) {
for (let i = 0; i < set2.length; i++)
if (debug(set2[i].semver), set2[i].semver !== Comparator.ANY && set2[i].semver.prerelease.length > 0) {
let allowed = set2[i].semver;
if (allowed.major === version.major && allowed.minor === version.minor && allowed.patch === version.patch)
return !0;
}
return !1;
}
return !0;
};
}
});
// node_modules/semver/classes/comparator.js
var require_comparator = __commonJS({
"node_modules/semver/classes/comparator.js"(exports2, modul