| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 8914a52 commit 7d52950
3 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -19521,6 +19521,7 @@ const MAX_LENGTH$1 = 256; | |||
| 19521 | 19521 | const MAX_SAFE_INTEGER$1 = Number.MAX_SAFE_INTEGER || | |
| 19522 | 19522 | 9007199254740991; | |
| 19523 | 19523 | const MAX_SAFE_COMPONENT_LENGTH = 16; | |
| 19524 | + const MAX_SAFE_BUILD_LENGTH = MAX_LENGTH$1 - 6; | ||
| 19524 | 19525 | const RELEASE_TYPES = [ | |
| 19525 | 19526 | 'major', | |
| 19526 | 19527 | 'premajor', | |
@@ -19533,6 +19534,7 @@ const RELEASE_TYPES = [ | |||
| 19533 | 19534 | var constants = { | |
| 19534 | 19535 | MAX_LENGTH: MAX_LENGTH$1, | |
| 19535 | 19536 | MAX_SAFE_COMPONENT_LENGTH, | |
| 19537 | + MAX_SAFE_BUILD_LENGTH, | ||
| 19536 | 19538 | MAX_SAFE_INTEGER: MAX_SAFE_INTEGER$1, | |
| 19537 | 19539 | RELEASE_TYPES, | |
| 19538 | 19540 | SEMVER_SPEC_VERSION, | |
@@ -19544,18 +19546,30 @@ getDefaultExportFromCjs(constants); | |||
| 19544 | 19546 | var re$1 = {exports: {}}; | |
| 19545 | 19547 | ||
| 19546 | 19548 | (function (module, exports) { | |
| 19547 | - const { MAX_SAFE_COMPONENT_LENGTH } = constants; | ||
| 19549 | + const { MAX_SAFE_COMPONENT_LENGTH, MAX_SAFE_BUILD_LENGTH } = constants; | ||
| 19548 | 19550 | const debug = debug_1; | |
| 19549 | 19551 | exports = module.exports = {}; | |
| 19550 | 19552 | const re = exports.re = []; | |
| 19551 | 19553 | const safeRe = exports.safeRe = []; | |
| 19552 | 19554 | const src = exports.src = []; | |
| 19553 | 19555 | const t = exports.t = {}; | |
| 19554 | 19556 | let R = 0; | |
| 19557 | + const LETTERDASHNUMBER = '[a-zA-Z0-9-]'; | ||
| 19558 | + const safeRegexReplacements = [ | ||
| 19559 | + ['\\s', 1], | ||
| 19560 | + ['\\d', MAX_SAFE_COMPONENT_LENGTH], | ||
| 19561 | + [LETTERDASHNUMBER, MAX_SAFE_BUILD_LENGTH], | ||
| 19562 | + ]; | ||
| 19563 | + const makeSafeRegex = (value) => { | ||
| 19564 | + for (const [token, max] of safeRegexReplacements) { | ||
| 19565 | + value = value | ||
| 19566 | + .split(`${token}*`).join(`${token}{0,${max}}`) | ||
| 19567 | + .split(`${token}+`).join(`${token}{1,${max}}`); | ||
| 19568 | + } | ||
| 19569 | + return value | ||
| 19570 | + }; | ||
| 19555 | 19571 | const createToken = (name, value, isGlobal) => { | |
| 19556 | - const safe = value | ||
| 19557 | - .split('\\s*').join('\\s{0,1}') | ||
| 19558 | - .split('\\s+').join('\\s'); | ||
| 19572 | + const safe = makeSafeRegex(value); | ||
| 19559 | 19573 | const index = R++; | |
| 19560 | 19574 | debug(name, index, value); | |
| 19561 | 19575 | t[name] = index; | |
@@ -19564,8 +19578,8 @@ var re$1 = {exports: {}}; | |||
| 19564 | 19578 | safeRe[index] = new RegExp(safe, isGlobal ? 'g' : undefined); | |
| 19565 | 19579 | }; | |
| 19566 | 19580 | createToken('NUMERICIDENTIFIER', '0|[1-9]\\d*'); | |
| 19567 | - createToken('NUMERICIDENTIFIERLOOSE', '[0-9]+'); | ||
| 19568 | - createToken('NONNUMERICIDENTIFIER', '\\d*[a-zA-Z-][a-zA-Z0-9-]*'); | ||
| 19581 | + createToken('NUMERICIDENTIFIERLOOSE', '\\d+'); | ||
| 19582 | + createToken('NONNUMERICIDENTIFIER', `\\d*[a-zA-Z-]${LETTERDASHNUMBER}*`); | ||
| 19569 | 19583 | createToken('MAINVERSION', `(${src[t.NUMERICIDENTIFIER]})\\.` + | |
| 19570 | 19584 | `(${src[t.NUMERICIDENTIFIER]})\\.` + | |
| 19571 | 19585 | `(${src[t.NUMERICIDENTIFIER]})`); | |
@@ -19580,7 +19594,7 @@ var re$1 = {exports: {}}; | |||
| 19580 | 19594 | }(?:\\.${src[t.PRERELEASEIDENTIFIER]})*))`); | |
| 19581 | 19595 | createToken('PRERELEASELOOSE', `(?:-?(${src[t.PRERELEASEIDENTIFIERLOOSE] | |
| 19582 | 19596 | }(?:\\.${src[t.PRERELEASEIDENTIFIERLOOSE]})*))`); | |
| 19583 | - createToken('BUILDIDENTIFIER', '[0-9A-Za-z-]+'); | ||
| 19597 | + createToken('BUILDIDENTIFIER', `${LETTERDASHNUMBER}+`); | ||
| 19584 | 19598 | createToken('BUILD', `(?:\\+(${src[t.BUILDIDENTIFIER] | |
| 19585 | 19599 | }(?:\\.${src[t.BUILDIDENTIFIER]})*))`); | |
| 19586 | 19600 | createToken('FULLPLAIN', `v?${src[t.MAINVERSION] | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -14,9 +14,9 @@ | |||
| 14 | 14 | "vfile-reporter": "^8.0.0" | |
| 15 | 15 | }, | |
| 16 | 16 | "devDependencies": { | |
| 17 | - "@rollup/plugin-commonjs": "^25.0.1", | ||
| 17 | + "@rollup/plugin-commonjs": "^25.0.2", | ||
| 18 | 18 | "@rollup/plugin-node-resolve": "^15.1.0", | |
| 19 | - "rollup": "^3.25.1", | ||
| 19 | + "rollup": "^3.25.2", | ||
| 20 | 20 | "rollup-plugin-cleanup": "^3.2.1" | |
| 21 | 21 | } | |
| 22 | 22 | } | |
| Back | FazBrowse Home | New Git URL |
0 commit comments