@@ -19480,6 +19480,7 @@ var require_re = __commonJS({
19480
19480
var re = exports.re = [];
19481
19481
var safeRe = exports.safeRe = [];
19482
19482
var src = exports.src = [];
19483
+ var safeSrc = exports.safeSrc = [];
19483
19484
var t = exports.t = {};
19484
19485
var R = 0;
19485
19486
var LETTERDASHNUMBER = "[a-zA-Z0-9-]";
@@ -19500,6 +19501,7 @@ var require_re = __commonJS({
19500
19501
debug(name, index, value);
19501
19502
t[name] = index;
19502
19503
src[index] = value;
19504
+ safeSrc[index] = safe;
19503
19505
re[index] = new RegExp(value, isGlobal ? "g" : void 0);
19504
19506
safeRe[index] = new RegExp(safe, isGlobal ? "g" : void 0);
19505
19507
};
@@ -19596,7 +19598,7 @@ var require_semver = __commonJS({
19596
19598
""(exports, module) {
19597
19599
var debug = require_debug();
19598
19600
var { MAX_LENGTH, MAX_SAFE_INTEGER } = require_constants6();
19599
- var { safeRe: re, t } = require_re();
19601
+ var { safeRe: re, safeSrc: src, t } = require_re();
19600
19602
var parseOptions2 = require_parse_options();
19601
19603
var { compareIdentifiers } = require_identifiers();
19602
19604
var SemVer = class {
@@ -19739,7 +19741,8 @@ var require_semver = __commonJS({
19739
19741
throw new Error("invalid increment argument: identifier is empty");
19740
19742
}
19741
19743
if (identifier) {
19742
- const match2 = `-${identifier}`.match(this.options.loose ? re[t.PRERELEASELOOSE] : re[t.PRERELEASE]);
19744
+ const r = new RegExp(`^${this.options.loose ? src[t.PRERELEASELOOSE] : src[t.PRERELEASE]}$`);
19745
+ const match2 = `-${identifier}`.match(r);
19743
19746
if (!match2 || match2[1] !== identifier) {
19744
19747
throw new Error(`invalid identifier: ${identifier}`);
19745
19748
}
0 commit comments