@@ -19480,6 +19480,7 @@ var require_re = __commonJS({
1948019480 var re = exports.re = [];
1948119481 var safeRe = exports.safeRe = [];
1948219482 var src = exports.src = [];
19483+ var safeSrc = exports.safeSrc = [];
1948319484 var t = exports.t = {};
1948419485 var R = 0;
1948519486 var LETTERDASHNUMBER = "[a-zA-Z0-9-]";
@@ -19500,6 +19501,7 @@ var require_re = __commonJS({
1950019501 debug(name, index, value);
1950119502 t[name] = index;
1950219503 src[index] = value;
19504+ safeSrc[index] = safe;
1950319505 re[index] = new RegExp(value, isGlobal ? "g" : void 0);
1950419506 safeRe[index] = new RegExp(safe, isGlobal ? "g" : void 0);
1950519507 };
@@ -19596,7 +19598,7 @@ var require_semver = __commonJS({
1959619598 ""(exports, module) {
1959719599 var debug = require_debug();
1959819600 var { MAX_LENGTH, MAX_SAFE_INTEGER } = require_constants6();
19599- var { safeRe: re, t } = require_re();
19601+ var { safeRe: re, safeSrc: src, t } = require_re();
1960019602 var parseOptions2 = require_parse_options();
1960119603 var { compareIdentifiers } = require_identifiers();
1960219604 var SemVer = class {
@@ -19739,7 +19741,8 @@ var require_semver = __commonJS({
1973919741 throw new Error("invalid increment argument: identifier is empty");
1974019742 }
1974119743 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);
1974319746 if (!match2 || match2[1] !== identifier) {
1974419747 throw new Error(`invalid identifier: ${identifier}`);
1974519748 }
0 commit comments