diff --git a/dist/index.js b/dist/index.js index 1f53f8a4..d95f67a8 100644 --- a/dist/index.js +++ b/dist/index.js @@ -732,7 +732,7 @@ class OidcClient { .catch(error => { throw new Error(`Failed to get ID Token. \n Error Code : ${error.statusCode}\n - Error Message: ${error.message}`); + Error Message: ${error.result.message}`); }); const id_token = (_a = res.result) === null || _a === void 0 ? void 0 : _a.value; if (!id_token) { @@ -4719,7 +4719,6 @@ class Comparator { static get ANY () { return ANY } - constructor (comp, options) { options = parseOptions(options) @@ -4731,7 +4730,6 @@ class Comparator { } } - comp = comp.trim().split(/\s+/).join(' ') debug('comparator', comp, options) this.options = options this.loose = !!options.loose @@ -4794,6 +4792,13 @@ class Comparator { throw new TypeError('a Comparator is required') } + if (!options || typeof options !== 'object') { + options = { + loose: !!options, + includePrerelease: false + } + } + if (this.operator === '') { if (this.value === '') { return true @@ -4806,50 +4811,39 @@ class Comparator { return new Range(this.value, options).test(comp.semver) } - options = parseOptions(options) + const sameDirectionIncreasing = + (this.operator === '>=' || this.operator === '>') && + (comp.operator === '>=' || comp.operator === '>') + const sameDirectionDecreasing = + (this.operator === '<=' || this.operator === '<') && + (comp.operator === '<=' || comp.operator === '<') + const sameSemVer = this.semver.version === comp.semver.version + const differentDirectionsInclusive = + (this.operator === '>=' || this.operator === '<=') && + (comp.operator === '>=' || comp.operator === '<=') + const oppositeDirectionsLessThan = + cmp(this.semver, '<', comp.semver, options) && + (this.operator === '>=' || this.operator === '>') && + (comp.operator === '<=' || comp.operator === '<') + const oppositeDirectionsGreaterThan = + cmp(this.semver, '>', comp.semver, options) && + (this.operator === '<=' || this.operator === '<') && + (comp.operator === '>=' || comp.operator === '>') - // Special cases where nothing can possibly be lower - if (options.includePrerelease && - (this.value === '<0.0.0-0' || comp.value === '<0.0.0-0')) { - return false - } - if (!options.includePrerelease && - (this.value.startsWith('<0.0.0') || comp.value.startsWith('<0.0.0'))) { - return false - } - - // Same direction increasing (> or >=) - if (this.operator.startsWith('>') && comp.operator.startsWith('>')) { - return true - } - // Same direction decreasing (< or <=) - if (this.operator.startsWith('<') && comp.operator.startsWith('<')) { - return true - } - // same SemVer and both sides are inclusive (<= or >=) - if ( - (this.semver.version === comp.semver.version) && - this.operator.includes('=') && comp.operator.includes('=')) { - return true - } - // opposite directions less than - if (cmp(this.semver, '<', comp.semver, options) && - this.operator.startsWith('>') && comp.operator.startsWith('<')) { - return true - } - // opposite directions greater than - if (cmp(this.semver, '>', comp.semver, options) && - this.operator.startsWith('<') && comp.operator.startsWith('>')) { - return true - } - return false + return ( + sameDirectionIncreasing || + sameDirectionDecreasing || + (sameSemVer && differentDirectionsInclusive) || + oppositeDirectionsLessThan || + oppositeDirectionsGreaterThan + ) } } module.exports = Comparator const parseOptions = __nccwpck_require__(168) -const { safeRe: re, t } = __nccwpck_require__(8413) +const {re, t} = __nccwpck_require__(8413) const cmp = __nccwpck_require__(2925) const debug = __nccwpck_require__(8629) const SemVer = __nccwpck_require__(9034) @@ -4889,26 +4883,19 @@ class Range { this.loose = !!options.loose this.includePrerelease = !!options.includePrerelease - // First reduce all whitespace as much as possible so we do not have to rely - // on potentially slow regexes like \s*. This is then stored and used for - // future error messages as well. + // First, split based on boolean or || this.raw = range - .trim() - .split(/\s+/) - .join(' ') - - // First, split on || - this.set = this.raw - .split('||') + this.set = range + .split(/\s*\|\|\s*/) // map the range to a 2d array of comparators - .map(r => this.parseRange(r.trim())) + .map(range => this.parseRange(range.trim())) // throw out any comparator lists that are empty // this generally means that it was not a valid range, which is allowed // in loose mode, but will still throw if the WHOLE range is invalid. .filter(c => c.length) if (!this.set.length) { - throw new TypeError(`Invalid SemVer Range: ${this.raw}`) + throw new TypeError(`Invalid SemVer Range: ${range}`) } // if we have any that are not the null set, throw out null sets. @@ -4916,9 +4903,9 @@ class Range { // keep the first one, in case they're all null sets const first = this.set[0] this.set = this.set.filter(c => !isNullSet(c[0])) - if (this.set.length === 0) { + if (this.set.length === 0) this.set = [first] - } else if (this.set.length > 1) { + else if (this.set.length > 1) { // if we have any that are *, then the range is just * for (const c of this.set) { if (c.length === 1 && isAny(c[0])) { @@ -4934,7 +4921,9 @@ class Range { format () { this.range = this.set - .map((comps) => comps.join(' ').trim()) + .map((comps) => { + return comps.join(' ').trim() + }) .join('||') .trim() return this.range @@ -4945,69 +4934,61 @@ class Range { } parseRange (range) { + range = range.trim() + // memoize range parsing for performance. // this is a very hot path, and fully deterministic. - const memoOpts = - (this.options.includePrerelease && FLAG_INCLUDE_PRERELEASE) | - (this.options.loose && FLAG_LOOSE) - const memoKey = memoOpts + ':' + range + const memoOpts = Object.keys(this.options).join(',') + const memoKey = `parseRange:${memoOpts}:${range}` const cached = cache.get(memoKey) - if (cached) { + if (cached) return cached - } const loose = this.options.loose // `1.2.3 - 1.2.4` => `>=1.2.3 <=1.2.4` const hr = loose ? re[t.HYPHENRANGELOOSE] : re[t.HYPHENRANGE] range = range.replace(hr, hyphenReplace(this.options.includePrerelease)) debug('hyphen replace', range) - // `> 1.2.3 < 1.2.5` => `>1.2.3 <1.2.5` range = range.replace(re[t.COMPARATORTRIM], comparatorTrimReplace) - debug('comparator trim', range) + debug('comparator trim', range, re[t.COMPARATORTRIM]) // `~ 1.2.3` => `~1.2.3` range = range.replace(re[t.TILDETRIM], tildeTrimReplace) - debug('tilde trim', range) // `^ 1.2.3` => `^1.2.3` range = range.replace(re[t.CARETTRIM], caretTrimReplace) - debug('caret trim', range) + + // normalize spaces + range = range.split(/\s+/).join(' ') // At this point, the range is completely trimmed and // ready to be split into comparators. - let rangeList = range + const compRe = loose ? re[t.COMPARATORLOOSE] : re[t.COMPARATOR] + const rangeList = range .split(' ') .map(comp => parseComparator(comp, this.options)) .join(' ') .split(/\s+/) // >=0.0.0 is equivalent to * .map(comp => replaceGTE0(comp, this.options)) - - if (loose) { // in loose mode, throw out any that are not valid comparators - rangeList = rangeList.filter(comp => { - debug('loose invalid filter', comp, this.options) - return !!comp.match(re[t.COMPARATORLOOSE]) - }) - } - debug('range list', rangeList) + .filter(this.options.loose ? comp => !!comp.match(compRe) : () => true) + .map(comp => new Comparator(comp, this.options)) // if any comparators are the null set, then replace with JUST null set // if more than one comparator, remove any * comparators // also, don't include the same comparator more than once + const l = rangeList.length const rangeMap = new Map() - const comparators = rangeList.map(comp => new Comparator(comp, this.options)) - for (const comp of comparators) { - if (isNullSet(comp)) { + for (const comp of rangeList) { + if (isNullSet(comp)) return [comp] - } rangeMap.set(comp.value, comp) } - if (rangeMap.size > 1 && rangeMap.has('')) { + if (rangeMap.size > 1 && rangeMap.has('')) rangeMap.delete('') - } const result = [...rangeMap.values()] cache.set(memoKey, result) @@ -5058,7 +5039,6 @@ class Range { return false } } - module.exports = Range const LRU = __nccwpck_require__(7129) @@ -5069,13 +5049,12 @@ const Comparator = __nccwpck_require__(7088) const debug = __nccwpck_require__(8629) const SemVer = __nccwpck_require__(9034) const { - safeRe: re, + re, t, comparatorTrimReplace, tildeTrimReplace, - caretTrimReplace, + caretTrimReplace } = __nccwpck_require__(8413) -const { FLAG_INCLUDE_PRERELEASE, FLAG_LOOSE } = __nccwpck_require__(8577) const isNullSet = c => c.value === '<0.0.0-0' const isAny = c => c.value === '' @@ -5122,14 +5101,10 @@ const isX = id => !id || id.toLowerCase() === 'x' || id === '*' // ~1.2, ~1.2.x, ~>1.2, ~>1.2.x --> >=1.2.0 <1.3.0-0 // ~1.2.3, ~>1.2.3 --> >=1.2.3 <1.3.0-0 // ~1.2.0, ~>1.2.0 --> >=1.2.0 <1.3.0-0 -// ~0.0.1 --> >=0.0.1 <0.1.0-0 -const replaceTildes = (comp, options) => { - return comp - .trim() - .split(/\s+/) - .map((c) => replaceTilde(c, options)) - .join(' ') -} +const replaceTildes = (comp, options) => + comp.trim().split(/\s+/).map((comp) => { + return replaceTilde(comp, options) + }).join(' ') const replaceTilde = (comp, options) => { const r = options.loose ? re[t.TILDELOOSE] : re[t.TILDE] @@ -5165,15 +5140,10 @@ const replaceTilde = (comp, options) => { // ^1.2, ^1.2.x --> >=1.2.0 <2.0.0-0 // ^1.2.3 --> >=1.2.3 <2.0.0-0 // ^1.2.0 --> >=1.2.0 <2.0.0-0 -// ^0.0.1 --> >=0.0.1 <0.0.2-0 -// ^0.1.0 --> >=0.1.0 <0.2.0-0 -const replaceCarets = (comp, options) => { - return comp - .trim() - .split(/\s+/) - .map((c) => replaceCaret(c, options)) - .join(' ') -} +const replaceCarets = (comp, options) => + comp.trim().split(/\s+/).map((comp) => { + return replaceCaret(comp, options) + }).join(' ') const replaceCaret = (comp, options) => { debug('caret', comp, options) @@ -5230,10 +5200,9 @@ const replaceCaret = (comp, options) => { const replaceXRanges = (comp, options) => { debug('replaceXRanges', comp, options) - return comp - .split(/\s+/) - .map((c) => replaceXRange(c, options)) - .join(' ') + return comp.split(/\s+/).map((comp) => { + return replaceXRange(comp, options) + }).join(' ') } const replaceXRange = (comp, options) => { @@ -5293,9 +5262,8 @@ const replaceXRange = (comp, options) => { } } - if (gtlt === '<') { + if (gtlt === '<') pr = '-0' - } ret = `${gtlt + M}.${m}.${p}${pr}` } else if (xm) { @@ -5316,15 +5284,12 @@ const replaceXRange = (comp, options) => { const replaceStars = (comp, options) => { debug('replaceStars', comp, options) // Looseness is ignored here. star is always as loose as it gets! - return comp - .trim() - .replace(re[t.STAR], '') + return comp.trim().replace(re[t.STAR], '') } const replaceGTE0 = (comp, options) => { debug('replaceGTE0', comp, options) - return comp - .trim() + return comp.trim() .replace(re[options.includePrerelease ? t.GTE0PRE : t.GTE0], '') } @@ -5362,7 +5327,7 @@ const hyphenReplace = incPr => ($0, to = `<=${to}` } - return `${from} ${to}`.trim() + return (`${from} ${to}`).trim() } const testSet = (set, version, options) => { @@ -5409,7 +5374,7 @@ const testSet = (set, version, options) => { const debug = __nccwpck_require__(8629) const { MAX_LENGTH, MAX_SAFE_INTEGER } = __nccwpck_require__(8577) -const { safeRe: re, t } = __nccwpck_require__(8413) +const { re, t } = __nccwpck_require__(8413) const parseOptions = __nccwpck_require__(168) const { compareIdentifiers } = __nccwpck_require__(6426) @@ -5425,7 +5390,7 @@ class SemVer { version = version.version } } else if (typeof version !== 'string') { - throw new TypeError(`Invalid version. Must be a string. Got type "${typeof version}".`) + throw new TypeError(`Invalid Version: ${version}`) } if (version.length > MAX_LENGTH) { @@ -5584,36 +5549,36 @@ class SemVer { // 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) { + inc (release, identifier) { switch (release) { case 'premajor': this.prerelease.length = 0 this.patch = 0 this.minor = 0 this.major++ - this.inc('pre', identifier, identifierBase) + this.inc('pre', identifier) break case 'preminor': this.prerelease.length = 0 this.patch = 0 this.minor++ - this.inc('pre', identifier, identifierBase) + this.inc('pre', identifier) break case 'prepatch': // If this is already a prerelease, it will bump to the next version // drop any prereleases that might already exist, since they are not // relevant at this point. this.prerelease.length = 0 - this.inc('patch', identifier, identifierBase) - this.inc('pre', identifier, identifierBase) + this.inc('patch', identifier) + this.inc('pre', identifier) break // If the input is a non-prerelease version, this acts the same as // prepatch. case 'prerelease': if (this.prerelease.length === 0) { - this.inc('patch', identifier, identifierBase) + this.inc('patch', identifier) } - this.inc('pre', identifier, identifierBase) + this.inc('pre', identifier) break case 'major': @@ -5655,15 +5620,9 @@ class SemVer { 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': { - const base = Number(identifierBase) ? 1 : 0 - - if (!identifier && identifierBase === false) { - throw new Error('invalid increment argument: identifier is empty') - } - + case 'pre': if (this.prerelease.length === 0) { - this.prerelease = [base] + this.prerelease = [0] } else { let i = this.prerelease.length while (--i >= 0) { @@ -5674,36 +5633,27 @@ class SemVer { } if (i === -1) { // didn't increment anything - if (identifier === this.prerelease.join('.') && identifierBase === false) { - throw new Error('invalid increment argument: identifier already exists') - } - this.prerelease.push(base) + this.prerelease.push(0) } } if (identifier) { // 1.2.0-beta.1 bumps to 1.2.0-beta.2, // 1.2.0-beta.fooblz or 1.2.0-beta bumps to 1.2.0-beta.0 - let prerelease = [identifier, base] - if (identifierBase === false) { - prerelease = [identifier] - } - if (compareIdentifiers(this.prerelease[0], identifier) === 0) { + if (this.prerelease[0] === identifier) { if (isNaN(this.prerelease[1])) { - this.prerelease = prerelease + this.prerelease = [identifier, 0] } } else { - this.prerelease = prerelease + this.prerelease = [identifier, 0] } } break - } + default: throw new Error(`invalid increment argument: ${release}`) } - this.raw = this.format() - if (this.build.length) { - this.raw += `+${this.build.join('.')}` - } + this.format() + this.raw = this.version return this } } @@ -5739,21 +5689,17 @@ const lte = __nccwpck_require__(9039) const cmp = (a, op, b, loose) => { switch (op) { case '===': - if (typeof a === 'object') { + if (typeof a === 'object') a = a.version - } - if (typeof b === 'object') { + if (typeof b === 'object') b = b.version - } return a === b case '!==': - if (typeof a === 'object') { + if (typeof a === 'object') a = a.version - } - if (typeof b === 'object') { + if (typeof b === 'object') b = b.version - } return a !== b case '': @@ -5790,7 +5736,7 @@ module.exports = cmp const SemVer = __nccwpck_require__(9034) const parse = __nccwpck_require__(9105) -const { safeRe: re, t } = __nccwpck_require__(8413) +const {re, t} = __nccwpck_require__(8413) const coerce = (version, options) => { if (version instanceof SemVer) { @@ -5833,9 +5779,8 @@ const coerce = (version, options) => { re[t.COERCERTL].lastIndex = -1 } - if (match === null) { + if (match === null) return null - } return parse(`${match[2]}.${match[3] || '0'}.${match[4] || '0'}`, options) } @@ -5884,69 +5829,27 @@ module.exports = compare /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { const parse = __nccwpck_require__(9105) +const eq = __nccwpck_require__(2466) const diff = (version1, version2) => { - const v1 = parse(version1, null, true) - const v2 = parse(version2, null, true) - const comparison = v1.compare(v2) - - if (comparison === 0) { + if (eq(version1, version2)) { return null - } - - const v1Higher = comparison > 0 - const highVersion = v1Higher ? v1 : v2 - const lowVersion = v1Higher ? v2 : v1 - const highHasPre = !!highVersion.prerelease.length - const lowHasPre = !!lowVersion.prerelease.length - - if (lowHasPre && !highHasPre) { - // Going from prerelease -> no prerelease requires some special casing - - // If the low version has only a major, then it will always be a major - // Some examples: - // 1.0.0-1 -> 1.0.0 - // 1.0.0-1 -> 1.1.1 - // 1.0.0-1 -> 2.0.0 - if (!lowVersion.patch && !lowVersion.minor) { - return 'major' - } - - // Otherwise it can be determined by checking the high version - - if (highVersion.patch) { - // anything higher than a patch bump would result in the wrong version - return 'patch' - } - - if (highVersion.minor) { - // anything higher than a minor bump would result in the wrong version - return 'minor' + } else { + const v1 = parse(version1) + const v2 = parse(version2) + const hasPre = v1.prerelease.length || v2.prerelease.length + const prefix = hasPre ? 'pre' : '' + const defaultResult = hasPre ? 'prerelease' : '' + for (const key in v1) { + if (key === 'major' || key === 'minor' || key === 'patch') { + if (v1[key] !== v2[key]) { + return prefix + key + } + } } - - // bumping major/minor/patch all have same result - return 'major' - } - - // add the `pre` prefix if we are going to a prerelease version - const prefix = highHasPre ? 'pre' : '' - - if (v1.major !== v2.major) { - return prefix + 'major' - } - - if (v1.minor !== v2.minor) { - return prefix + 'minor' - } - - if (v1.patch !== v2.patch) { - return prefix + 'patch' + return defaultResult // may be undefined } - - // high and low are preleases - return 'prerelease' } - module.exports = diff @@ -5987,18 +5890,14 @@ module.exports = gte const SemVer = __nccwpck_require__(9034) -const inc = (version, release, options, identifier, identifierBase) => { +const inc = (version, release, options, identifier) => { if (typeof (options) === 'string') { - identifierBase = identifier identifier = options options = undefined } try { - return new SemVer( - version instanceof SemVer ? version.version : version, - options - ).inc(release, identifier, identifierBase).version + return new SemVer(version, options).inc(release, identifier).version } catch (er) { return null } @@ -6061,18 +5960,35 @@ module.exports = neq /***/ 9105: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { +const {MAX_LENGTH} = __nccwpck_require__(8577) +const { re, t } = __nccwpck_require__(8413) const SemVer = __nccwpck_require__(9034) -const parse = (version, options, throwErrors = false) => { + +const parseOptions = __nccwpck_require__(168) +const parse = (version, options) => { + options = parseOptions(options) + if (version instanceof SemVer) { return version } + + if (typeof version !== 'string') { + return null + } + + if (version.length > MAX_LENGTH) { + return null + } + + const r = options.loose ? re[t.LOOSE] : re[t.FULL] + if (!r.test(version)) { + return null + } + try { return new SemVer(version, options) } catch (er) { - if (!throwErrors) { - return null - } - throw er + return null } } @@ -6169,92 +6085,51 @@ module.exports = valid // just pre-load all the stuff that index.js lazily exports const internalRe = __nccwpck_require__(8413) -const constants = __nccwpck_require__(8577) -const SemVer = __nccwpck_require__(9034) -const identifiers = __nccwpck_require__(6426) -const parse = __nccwpck_require__(9105) -const valid = __nccwpck_require__(3269) -const clean = __nccwpck_require__(8764) -const inc = __nccwpck_require__(3989) -const diff = __nccwpck_require__(1581) -const major = __nccwpck_require__(9445) -const minor = __nccwpck_require__(7365) -const patch = __nccwpck_require__(8815) -const prerelease = __nccwpck_require__(5377) -const compare = __nccwpck_require__(8118) -const rcompare = __nccwpck_require__(1037) -const compareLoose = __nccwpck_require__(186) -const compareBuild = __nccwpck_require__(9676) -const sort = __nccwpck_require__(4546) -const rsort = __nccwpck_require__(4558) -const gt = __nccwpck_require__(1622) -const lt = __nccwpck_require__(6182) -const eq = __nccwpck_require__(2466) -const neq = __nccwpck_require__(733) -const gte = __nccwpck_require__(8226) -const lte = __nccwpck_require__(9039) -const cmp = __nccwpck_require__(2925) -const coerce = __nccwpck_require__(9534) -const Comparator = __nccwpck_require__(7088) -const Range = __nccwpck_require__(8645) -const satisfies = __nccwpck_require__(1780) -const toComparators = __nccwpck_require__(4761) -const maxSatisfying = __nccwpck_require__(5243) -const minSatisfying = __nccwpck_require__(1952) -const minVersion = __nccwpck_require__(7706) -const validRange = __nccwpck_require__(8081) -const outside = __nccwpck_require__(282) -const gtr = __nccwpck_require__(4136) -const ltr = __nccwpck_require__(9475) -const intersects = __nccwpck_require__(9557) -const simplifyRange = __nccwpck_require__(8948) -const subset = __nccwpck_require__(5759) module.exports = { - parse, - valid, - clean, - inc, - diff, - major, - minor, - patch, - prerelease, - compare, - rcompare, - compareLoose, - compareBuild, - sort, - rsort, - gt, - lt, - eq, - neq, - gte, - lte, - cmp, - coerce, - Comparator, - Range, - satisfies, - toComparators, - maxSatisfying, - minSatisfying, - minVersion, - validRange, - outside, - gtr, - ltr, - intersects, - simplifyRange, - subset, - SemVer, re: internalRe.re, src: internalRe.src, tokens: internalRe.t, - SEMVER_SPEC_VERSION: constants.SEMVER_SPEC_VERSION, - RELEASE_TYPES: constants.RELEASE_TYPES, - compareIdentifiers: identifiers.compareIdentifiers, - rcompareIdentifiers: identifiers.rcompareIdentifiers, + SEMVER_SPEC_VERSION: (__nccwpck_require__(8577).SEMVER_SPEC_VERSION), + SemVer: __nccwpck_require__(9034), + compareIdentifiers: (__nccwpck_require__(6426).compareIdentifiers), + rcompareIdentifiers: (__nccwpck_require__(6426).rcompareIdentifiers), + parse: __nccwpck_require__(9105), + valid: __nccwpck_require__(3269), + clean: __nccwpck_require__(8764), + inc: __nccwpck_require__(3989), + diff: __nccwpck_require__(1581), + major: __nccwpck_require__(9445), + minor: __nccwpck_require__(7365), + patch: __nccwpck_require__(8815), + prerelease: __nccwpck_require__(5377), + compare: __nccwpck_require__(8118), + rcompare: __nccwpck_require__(1037), + compareLoose: __nccwpck_require__(186), + compareBuild: __nccwpck_require__(9676), + sort: __nccwpck_require__(4546), + rsort: __nccwpck_require__(4558), + gt: __nccwpck_require__(1622), + lt: __nccwpck_require__(6182), + eq: __nccwpck_require__(2466), + neq: __nccwpck_require__(733), + gte: __nccwpck_require__(8226), + lte: __nccwpck_require__(9039), + cmp: __nccwpck_require__(2925), + coerce: __nccwpck_require__(9534), + Comparator: __nccwpck_require__(7088), + Range: __nccwpck_require__(8645), + satisfies: __nccwpck_require__(1780), + toComparators: __nccwpck_require__(4761), + maxSatisfying: __nccwpck_require__(5243), + minSatisfying: __nccwpck_require__(1952), + minVersion: __nccwpck_require__(7706), + validRange: __nccwpck_require__(8081), + outside: __nccwpck_require__(282), + gtr: __nccwpck_require__(4136), + ltr: __nccwpck_require__(9475), + intersects: __nccwpck_require__(9557), + simplifyRange: __nccwpck_require__(8948), + subset: __nccwpck_require__(5759), } @@ -6269,34 +6144,16 @@ const SEMVER_SPEC_VERSION = '2.0.0' const MAX_LENGTH = 256 const MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER || -/* istanbul ignore next */ 9007199254740991 + /* istanbul ignore next */ 9007199254740991 // Max safe segment length for coercion. const MAX_SAFE_COMPONENT_LENGTH = 16 -// Max safe length for a build identifier. The max length minus 6 characters for -// the shortest version with a build 0.0.0+BUILD. -const MAX_SAFE_BUILD_LENGTH = MAX_LENGTH - 6 - -const RELEASE_TYPES = [ - 'major', - 'premajor', - 'minor', - 'preminor', - 'patch', - 'prepatch', - 'prerelease', -] - module.exports = { + SEMVER_SPEC_VERSION, MAX_LENGTH, - MAX_SAFE_COMPONENT_LENGTH, - MAX_SAFE_BUILD_LENGTH, MAX_SAFE_INTEGER, - RELEASE_TYPES, - SEMVER_SPEC_VERSION, - FLAG_INCLUDE_PRERELEASE: 0b001, - FLAG_LOOSE: 0b010, + MAX_SAFE_COMPONENT_LENGTH } @@ -6342,7 +6199,7 @@ const rcompareIdentifiers = (a, b) => compareIdentifiers(b, a) module.exports = { compareIdentifiers, - rcompareIdentifiers, + rcompareIdentifiers } @@ -6351,20 +6208,16 @@ module.exports = { /***/ 168: /***/ ((module) => { -// parse out just the options we care about -const looseOption = Object.freeze({ loose: true }) -const emptyOpts = Object.freeze({ }) -const parseOptions = options => { - if (!options) { - return emptyOpts - } - - if (typeof options !== 'object') { - return looseOption - } - - return options -} +// parse out just the options we care about so we always get a consistent +// obj with keys in a consistent order. +const opts = ['includePrerelease', 'loose', 'rtl'] +const parseOptions = options => + !options ? {} + : typeof options !== 'object' ? { loose: true } + : opts.filter(k => options[k]).reduce((options, k) => { + options[k] = true + return options + }, {}) module.exports = parseOptions @@ -6373,52 +6226,22 @@ module.exports = parseOptions /***/ 8413: /***/ ((module, exports, __nccwpck_require__) => { -const { - MAX_SAFE_COMPONENT_LENGTH, - MAX_SAFE_BUILD_LENGTH, - MAX_LENGTH, -} = __nccwpck_require__(8577) +const { MAX_SAFE_COMPONENT_LENGTH } = __nccwpck_require__(8577) const debug = __nccwpck_require__(8629) exports = module.exports = {} // The actual regexps go on exports.re const re = exports.re = [] -const safeRe = exports.safeRe = [] const src = exports.src = [] const t = exports.t = {} let R = 0 -const LETTERDASHNUMBER = '[a-zA-Z0-9-]' - -// Replace some greedy regex tokens to prevent regex dos issues. These regex are -// used internally via the safeRe object since all inputs in this library get -// normalized first to trim and collapse all extra whitespace. The original -// regexes are exported for userland consumption and lower level usage. A -// future breaking change could export the safer regex only with a note that -// all input should have extra whitespace removed. -const safeRegexReplacements = [ - ['\\s', 1], - ['\\d', MAX_LENGTH], - [LETTERDASHNUMBER, MAX_SAFE_BUILD_LENGTH], -] - -const makeSafeRegex = (value) => { - for (const [token, max] of safeRegexReplacements) { - value = value - .split(`${token}*`).join(`${token}{0,${max}}`) - .split(`${token}+`).join(`${token}{1,${max}}`) - } - return value -} - const createToken = (name, value, isGlobal) => { - const safe = makeSafeRegex(value) const index = R++ - debug(name, index, value) + debug(index, value) t[name] = index src[index] = value re[index] = new RegExp(value, isGlobal ? 'g' : undefined) - safeRe[index] = new RegExp(safe, isGlobal ? 'g' : undefined) } // The following Regular Expressions can be used for tokenizing, @@ -6428,13 +6251,13 @@ const createToken = (name, value, isGlobal) => { // A single `0`, or a non-zero digit followed by zero or more digits. createToken('NUMERICIDENTIFIER', '0|[1-9]\\d*') -createToken('NUMERICIDENTIFIERLOOSE', '\\d+') +createToken('NUMERICIDENTIFIERLOOSE', '[0-9]+') // ## Non-numeric Identifier // Zero or more digits, followed by a letter or hyphen, and then zero or // more letters, digits, or hyphens. -createToken('NONNUMERICIDENTIFIER', `\\d*[a-zA-Z-]${LETTERDASHNUMBER}*`) +createToken('NONNUMERICIDENTIFIER', '\\d*[a-zA-Z-][a-zA-Z0-9-]*') // ## Main Version // Three dot-separated numeric identifiers. @@ -6469,7 +6292,7 @@ createToken('PRERELEASELOOSE', `(?:-?(${src[t.PRERELEASEIDENTIFIERLOOSE] // ## Build Metadata Identifier // Any combination of digits, letters, or hyphens. -createToken('BUILDIDENTIFIER', `${LETTERDASHNUMBER}+`) +createToken('BUILDIDENTIFIER', '[0-9A-Za-z-]+') // ## Build Metadata // Plus sign, followed by one or more period-separated build metadata @@ -6583,8 +6406,8 @@ createToken('HYPHENRANGELOOSE', `^\\s*(${src[t.XRANGEPLAINLOOSE]})` + // Star ranges basically just allow anything at all. createToken('STAR', '(<|>)?=?\\s*\\*') // >=0.0.0 is like a star -createToken('GTE0', '^\\s*>=\\s*0\\.0\\.0\\s*$') -createToken('GTE0PRE', '^\\s*>=\\s*0\\.0\\.0-0\\s*$') +createToken('GTE0', '^\\s*>=\\s*0\.0\.0\\s*$') +createToken('GTE0PRE', '^\\s*>=\\s*0\.0\.0-0\\s*$') /***/ }), @@ -6607,7 +6430,7 @@ const Range = __nccwpck_require__(8645) const intersects = (r1, r2, options) => { r1 = new Range(r1, options) r2 = new Range(r2, options) - return r1.intersects(r2, options) + return r1.intersects(r2) } module.exports = intersects @@ -6740,9 +6563,8 @@ const minVersion = (range, loose) => { throw new Error(`Unexpected operation: ${comparator.operator}`) } }) - if (setMin && (!minver || gt(minver, setMin))) { + if (setMin && (!minver || gt(minver, setMin))) minver = setMin - } } if (minver && range.test(minver)) { @@ -6761,7 +6583,7 @@ module.exports = minVersion const SemVer = __nccwpck_require__(9034) const Comparator = __nccwpck_require__(7088) -const { ANY } = Comparator +const {ANY} = Comparator const Range = __nccwpck_require__(8645) const satisfies = __nccwpck_require__(1780) const gt = __nccwpck_require__(1622) @@ -6853,41 +6675,38 @@ const satisfies = __nccwpck_require__(1780) const compare = __nccwpck_require__(8118) module.exports = (versions, range, options) => { const set = [] - let first = null + let min = null let prev = null const v = versions.sort((a, b) => compare(a, b, options)) for (const version of v) { const included = satisfies(version, range, options) if (included) { prev = version - if (!first) { - first = version - } + if (!min) + min = version } else { if (prev) { - set.push([first, prev]) + set.push([min, prev]) } prev = null - first = null + min = null } } - if (first) { - set.push([first, null]) - } + if (min) + set.push([min, null]) const ranges = [] for (const [min, max] of set) { - if (min === max) { + if (min === max) ranges.push(min) - } else if (!max && min === v[0]) { + else if (!max && min === v[0]) ranges.push('*') - } else if (!max) { + else if (!max) ranges.push(`>=${min}`) - } else if (min === v[0]) { + else if (min === v[0]) ranges.push(`<=${max}`) - } else { + else ranges.push(`${min} - ${max}`) - } } const simplified = ranges.join(' || ') const original = typeof range.raw === 'string' ? range.raw : String(range) @@ -6943,9 +6762,8 @@ const compare = __nccwpck_require__(8118) // - Else return true const subset = (sub, dom, options = {}) => { - if (sub === dom) { + if (sub === dom) return true - } sub = new Range(sub, options) dom = new Range(dom, options) @@ -6955,87 +6773,73 @@ const subset = (sub, dom, options = {}) => { for (const simpleDom of dom.set) { const isSub = simpleSubset(simpleSub, simpleDom, options) sawNonNull = sawNonNull || isSub !== null - if (isSub) { + if (isSub) continue OUTER - } } // the null set is a subset of everything, but null simple ranges in // a complex range should be ignored. so if we saw a non-null range, // then we know this isn't a subset, but if EVERY simple range was null, // then it is a subset. - if (sawNonNull) { + if (sawNonNull) return false - } } return true } -const minimumVersionWithPreRelease = [new Comparator('>=0.0.0-0')] -const minimumVersion = [new Comparator('>=0.0.0')] - const simpleSubset = (sub, dom, options) => { - if (sub === dom) { + if (sub === dom) return true - } if (sub.length === 1 && sub[0].semver === ANY) { - if (dom.length === 1 && dom[0].semver === ANY) { + if (dom.length === 1 && dom[0].semver === ANY) return true - } else if (options.includePrerelease) { - sub = minimumVersionWithPreRelease - } else { - sub = minimumVersion - } + else if (options.includePrerelease) + sub = [ new Comparator('>=0.0.0-0') ] + else + sub = [ new Comparator('>=0.0.0') ] } if (dom.length === 1 && dom[0].semver === ANY) { - if (options.includePrerelease) { + if (options.includePrerelease) return true - } else { - dom = minimumVersion - } + else + dom = [ new Comparator('>=0.0.0') ] } const eqSet = new Set() let gt, lt for (const c of sub) { - if (c.operator === '>' || c.operator === '>=') { + if (c.operator === '>' || c.operator === '>=') gt = higherGT(gt, c, options) - } else if (c.operator === '<' || c.operator === '<=') { + else if (c.operator === '<' || c.operator === '<=') lt = lowerLT(lt, c, options) - } else { + else eqSet.add(c.semver) - } } - if (eqSet.size > 1) { + if (eqSet.size > 1) return null - } let gtltComp if (gt && lt) { gtltComp = compare(gt.semver, lt.semver, options) - if (gtltComp > 0) { + if (gtltComp > 0) return null - } else if (gtltComp === 0 && (gt.operator !== '>=' || lt.operator !== '<=')) { + else if (gtltComp === 0 && (gt.operator !== '>=' || lt.operator !== '<=')) return null - } } // will iterate one or zero times for (const eq of eqSet) { - if (gt && !satisfies(eq, String(gt), options)) { + if (gt && !satisfies(eq, String(gt), options)) return null - } - if (lt && !satisfies(eq, String(lt), options)) { + if (lt && !satisfies(eq, String(lt), options)) return null - } for (const c of dom) { - if (!satisfies(eq, String(c), options)) { + if (!satisfies(eq, String(c), options)) return false - } } return true @@ -7071,12 +6875,10 @@ const simpleSubset = (sub, dom, options) => { } if (c.operator === '>' || c.operator === '>=') { higher = higherGT(gt, c, options) - if (higher === c && higher !== gt) { + if (higher === c && higher !== gt) return false - } - } else if (gt.operator === '>=' && !satisfies(gt.semver, String(c), options)) { + } else if (gt.operator === '>=' && !satisfies(gt.semver, String(c), options)) return false - } } if (lt) { if (needDomLTPre) { @@ -7089,44 +6891,37 @@ const simpleSubset = (sub, dom, options) => { } if (c.operator === '<' || c.operator === '<=') { lower = lowerLT(lt, c, options) - if (lower === c && lower !== lt) { + if (lower === c && lower !== lt) return false - } - } else if (lt.operator === '<=' && !satisfies(lt.semver, String(c), options)) { + } else if (lt.operator === '<=' && !satisfies(lt.semver, String(c), options)) return false - } } - if (!c.operator && (lt || gt) && gtltComp !== 0) { + if (!c.operator && (lt || gt) && gtltComp !== 0) return false - } } // if there was a < or >, and nothing in the dom, then must be false // UNLESS it was limited by another range in the other direction. // Eg, >1.0.0 <1.0.1 is still a subset of <2.0.0 - if (gt && hasDomLT && !lt && gtltComp !== 0) { + if (gt && hasDomLT && !lt && gtltComp !== 0) return false - } - if (lt && hasDomGT && !gt && gtltComp !== 0) { + if (lt && hasDomGT && !gt && gtltComp !== 0) return false - } // we needed a prerelease range in a specific tuple, but didn't get one // then this isn't a subset. eg >=1.2.3-pre is not a subset of >=1.0.0, // because it includes prereleases in the 1.2.3 tuple - if (needDomGTPre || needDomLTPre) { + if (needDomGTPre || needDomLTPre) return false - } return true } // >=1.2.3 is lower than >1.2.3 const higherGT = (a, b, options) => { - if (!a) { + if (!a) return b - } const comp = compare(a.semver, b.semver, options) return comp > 0 ? a : comp < 0 ? b @@ -7136,9 +6931,8 @@ const higherGT = (a, b, options) => { // <=1.2.3 is higher than <1.2.3 const lowerLT = (a, b, options) => { - if (!a) { + if (!a) return b - } const comp = compare(a.semver, b.semver, options) return comp < 0 ? a : comp > 0 ? b @@ -18517,11 +18311,8 @@ var MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER || // Max safe segment length for coercion. var MAX_SAFE_COMPONENT_LENGTH = 16 -var MAX_SAFE_BUILD_LENGTH = MAX_LENGTH - 6 - // The actual regexps go on exports.re var re = exports.re = [] -var safeRe = exports.safeRe = [] var src = exports.src = [] var t = exports.tokens = {} var R = 0 @@ -18530,31 +18321,6 @@ function tok (n) { t[n] = R++ } -var LETTERDASHNUMBER = '[a-zA-Z0-9-]' - -// Replace some greedy regex tokens to prevent regex dos issues. These regex are -// used internally via the safeRe object since all inputs in this library get -// normalized first to trim and collapse all extra whitespace. The original -// regexes are exported for userland consumption and lower level usage. A -// future breaking change could export the safer regex only with a note that -// all input should have extra whitespace removed. -var safeRegexReplacements = [ - ['\\s', 1], - ['\\d', MAX_LENGTH], - [LETTERDASHNUMBER, MAX_SAFE_BUILD_LENGTH], -] - -function makeSafeRe (value) { - for (var i = 0; i < safeRegexReplacements.length; i++) { - var token = safeRegexReplacements[i][0] - var max = safeRegexReplacements[i][1] - value = value - .split(token + '*').join(token + '{0,' + max + '}') - .split(token + '+').join(token + '{1,' + max + '}') - } - return value -} - // The following Regular Expressions can be used for tokenizing, // validating, and parsing SemVer version strings. @@ -18564,14 +18330,14 @@ function makeSafeRe (value) { tok('NUMERICIDENTIFIER') src[t.NUMERICIDENTIFIER] = '0|[1-9]\\d*' tok('NUMERICIDENTIFIERLOOSE') -src[t.NUMERICIDENTIFIERLOOSE] = '\\d+' +src[t.NUMERICIDENTIFIERLOOSE] = '[0-9]+' // ## Non-numeric Identifier // Zero or more digits, followed by a letter or hyphen, and then zero or // more letters, digits, or hyphens. tok('NONNUMERICIDENTIFIER') -src[t.NONNUMERICIDENTIFIER] = '\\d*[a-zA-Z-]' + LETTERDASHNUMBER + '*' +src[t.NONNUMERICIDENTIFIER] = '\\d*[a-zA-Z-][a-zA-Z0-9-]*' // ## Main Version // Three dot-separated numeric identifiers. @@ -18613,7 +18379,7 @@ src[t.PRERELEASELOOSE] = '(?:-?(' + src[t.PRERELEASEIDENTIFIERLOOSE] + // Any combination of digits, letters, or hyphens. tok('BUILDIDENTIFIER') -src[t.BUILDIDENTIFIER] = LETTERDASHNUMBER + '+' +src[t.BUILDIDENTIFIER] = '[0-9A-Za-z-]+' // ## Build Metadata // Plus sign, followed by one or more period-separated build metadata @@ -18693,7 +18459,6 @@ src[t.COERCE] = '(^|[^\\d])' + '(?:$|[^\\d])' tok('COERCERTL') re[t.COERCERTL] = new RegExp(src[t.COERCE], 'g') -safeRe[t.COERCERTL] = new RegExp(makeSafeRe(src[t.COERCE]), 'g') // Tilde ranges. // Meaning is "reasonably at or greater than" @@ -18703,7 +18468,6 @@ src[t.LONETILDE] = '(?:~>?)' tok('TILDETRIM') src[t.TILDETRIM] = '(\\s*)' + src[t.LONETILDE] + '\\s+' re[t.TILDETRIM] = new RegExp(src[t.TILDETRIM], 'g') -safeRe[t.TILDETRIM] = new RegExp(makeSafeRe(src[t.TILDETRIM]), 'g') var tildeTrimReplace = '$1~' tok('TILDE') @@ -18719,7 +18483,6 @@ src[t.LONECARET] = '(?:\\^)' tok('CARETTRIM') src[t.CARETTRIM] = '(\\s*)' + src[t.LONECARET] + '\\s+' re[t.CARETTRIM] = new RegExp(src[t.CARETTRIM], 'g') -safeRe[t.CARETTRIM] = new RegExp(makeSafeRe(src[t.CARETTRIM]), 'g') var caretTrimReplace = '$1^' tok('CARET') @@ -18741,7 +18504,6 @@ src[t.COMPARATORTRIM] = '(\\s*)' + src[t.GTLT] + // this one has to use the /g flag re[t.COMPARATORTRIM] = new RegExp(src[t.COMPARATORTRIM], 'g') -safeRe[t.COMPARATORTRIM] = new RegExp(makeSafeRe(src[t.COMPARATORTRIM]), 'g') var comparatorTrimReplace = '$1$2$3' // Something like `1.2.3 - 1.2.4` @@ -18770,14 +18532,6 @@ for (var i = 0; i < R; i++) { debug(i, src[i]) if (!re[i]) { re[i] = new RegExp(src[i]) - - // Replace all greedy whitespace to prevent regex dos issues. These regex are - // used internally via the safeRe object since all inputs in this library get - // normalized first to trim and collapse all extra whitespace. The original - // regexes are exported for userland consumption and lower level usage. A - // future breaking change could export the safer regex only with a note that - // all input should have extra whitespace removed. - safeRe[i] = new RegExp(makeSafeRe(src[i])) } } @@ -18802,7 +18556,7 @@ function parse (version, options) { return null } - var r = options.loose ? safeRe[t.LOOSE] : safeRe[t.FULL] + var r = options.loose ? re[t.LOOSE] : re[t.FULL] if (!r.test(version)) { return null } @@ -18857,7 +18611,7 @@ function SemVer (version, options) { this.options = options this.loose = !!options.loose - var m = version.trim().match(options.loose ? safeRe[t.LOOSE] : safeRe[t.FULL]) + var m = version.trim().match(options.loose ? re[t.LOOSE] : re[t.FULL]) if (!m) { throw new TypeError('Invalid Version: ' + version) @@ -19302,7 +19056,6 @@ function Comparator (comp, options) { return new Comparator(comp, options) } - comp = comp.trim().split(/\s+/).join(' ') debug('comparator', comp, options) this.options = options this.loose = !!options.loose @@ -19319,7 +19072,7 @@ function Comparator (comp, options) { var ANY = {} Comparator.prototype.parse = function (comp) { - var r = this.options.loose ? safeRe[t.COMPARATORLOOSE] : safeRe[t.COMPARATOR] + var r = this.options.loose ? re[t.COMPARATORLOOSE] : re[t.COMPARATOR] var m = comp.match(r) if (!m) { @@ -19443,16 +19196,9 @@ function Range (range, options) { this.loose = !!options.loose this.includePrerelease = !!options.includePrerelease - // First reduce all whitespace as much as possible so we do not have to rely - // on potentially slow regexes like \s*. This is then stored and used for - // future error messages as well. - this.raw = range - .trim() - .split(/\s+/) - .join(' ') - // First, split based on boolean or || - this.set = this.raw.split('||').map(function (range) { + this.raw = range + this.set = range.split(/\s*\|\|\s*/).map(function (range) { return this.parseRange(range.trim()) }, this).filter(function (c) { // throw out any that are not relevant for whatever reason @@ -19460,7 +19206,7 @@ function Range (range, options) { }) if (!this.set.length) { - throw new TypeError('Invalid SemVer Range: ' + this.raw) + throw new TypeError('Invalid SemVer Range: ' + range) } this.format() @@ -19479,19 +19225,20 @@ Range.prototype.toString = function () { Range.prototype.parseRange = function (range) { var loose = this.options.loose + range = range.trim() // `1.2.3 - 1.2.4` => `>=1.2.3 <=1.2.4` - var hr = loose ? safeRe[t.HYPHENRANGELOOSE] : safeRe[t.HYPHENRANGE] + var hr = loose ? re[t.HYPHENRANGELOOSE] : re[t.HYPHENRANGE] range = range.replace(hr, hyphenReplace) debug('hyphen replace', range) // `> 1.2.3 < 1.2.5` => `>1.2.3 <1.2.5` - range = range.replace(safeRe[t.COMPARATORTRIM], comparatorTrimReplace) - debug('comparator trim', range, safeRe[t.COMPARATORTRIM]) + range = range.replace(re[t.COMPARATORTRIM], comparatorTrimReplace) + debug('comparator trim', range, re[t.COMPARATORTRIM]) // `~ 1.2.3` => `~1.2.3` - range = range.replace(safeRe[t.TILDETRIM], tildeTrimReplace) + range = range.replace(re[t.TILDETRIM], tildeTrimReplace) // `^ 1.2.3` => `^1.2.3` - range = range.replace(safeRe[t.CARETTRIM], caretTrimReplace) + range = range.replace(re[t.CARETTRIM], caretTrimReplace) // normalize spaces range = range.split(/\s+/).join(' ') @@ -19499,7 +19246,7 @@ Range.prototype.parseRange = function (range) { // At this point, the range is completely trimmed and // ready to be split into comparators. - var compRe = loose ? safeRe[t.COMPARATORLOOSE] : safeRe[t.COMPARATOR] + var compRe = loose ? re[t.COMPARATORLOOSE] : re[t.COMPARATOR] var set = range.split(' ').map(function (comp) { return parseComparator(comp, this.options) }, this).join(' ').split(/\s+/) @@ -19599,7 +19346,7 @@ function replaceTildes (comp, options) { } function replaceTilde (comp, options) { - var r = options.loose ? safeRe[t.TILDELOOSE] : safeRe[t.TILDE] + var r = options.loose ? re[t.TILDELOOSE] : re[t.TILDE] return comp.replace(r, function (_, M, m, p, pr) { debug('tilde', comp, _, M, m, p, pr) var ret @@ -19640,7 +19387,7 @@ function replaceCarets (comp, options) { function replaceCaret (comp, options) { debug('caret', comp, options) - var r = options.loose ? safeRe[t.CARETLOOSE] : safeRe[t.CARET] + var r = options.loose ? re[t.CARETLOOSE] : re[t.CARET] return comp.replace(r, function (_, M, m, p, pr) { debug('caret', comp, _, M, m, p, pr) var ret @@ -19699,7 +19446,7 @@ function replaceXRanges (comp, options) { function replaceXRange (comp, options) { comp = comp.trim() - var r = options.loose ? safeRe[t.XRANGELOOSE] : safeRe[t.XRANGE] + var r = options.loose ? re[t.XRANGELOOSE] : re[t.XRANGE] return comp.replace(r, function (ret, gtlt, M, m, p, pr) { debug('xRange', comp, ret, gtlt, M, m, p, pr) var xM = isX(M) @@ -19774,7 +19521,7 @@ function replaceXRange (comp, options) { function replaceStars (comp, options) { debug('replaceStars', comp, options) // Looseness is ignored here. star is always as loose as it gets! - return comp.trim().replace(safeRe[t.STAR], '') + return comp.trim().replace(re[t.STAR], '') } // This function is passed to string.replace(re[t.HYPHENRANGE]) @@ -20100,7 +19847,7 @@ function coerce (version, options) { var match = null if (!options.rtl) { - match = version.match(safeRe[t.COERCE]) + match = version.match(re[t.COERCE]) } else { // Find the right-most coercible string that does not share // a terminus with a more left-ward coercible string. @@ -20111,17 +19858,17 @@ function coerce (version, options) { // Stop when we get a match that ends at the string end, since no // coercible string can be more right-ward without the same terminus. var next - while ((next = safeRe[t.COERCERTL].exec(version)) && + while ((next = re[t.COERCERTL].exec(version)) && (!match || match.index + match[0].length !== version.length) ) { if (!match || next.index + next[0].length !== match.index + match[0].length) { match = next } - safeRe[t.COERCERTL].lastIndex = next.index + next[1].length + next[2].length + re[t.COERCERTL].lastIndex = next.index + next[1].length + next[2].length } // leave it in a clean state - safeRe[t.COERCERTL].lastIndex = -1 + re[t.COERCERTL].lastIndex = -1 } if (match === null) {