Skip to content

Commit a8b67ba

Browse files
bump semver to 7.5.3 (#90)
1 parent 1530d62 commit a8b67ba

File tree

4 files changed

+43
-20
lines changed

4 files changed

+43
-20
lines changed

.licenses/npm/semver-7.5.2.dep.yml .licenses/npm/semver-7.5.3.dep.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
name: semver
3-
version: 7.5.2
3+
version: 7.5.3
44
type: npm
55
summary: The semantic version parser used by npm.
66
homepage:

dist/index.js

+36-13
Original file line numberDiff line numberDiff line change
@@ -8834,15 +8834,18 @@ class Range {
88348834
const hr = loose ? re[t.HYPHENRANGELOOSE] : re[t.HYPHENRANGE]
88358835
range = range.replace(hr, hyphenReplace(this.options.includePrerelease))
88368836
debug('hyphen replace', range)
8837+
88378838
// `> 1.2.3 < 1.2.5` => `>1.2.3 <1.2.5`
88388839
range = range.replace(re[t.COMPARATORTRIM], comparatorTrimReplace)
88398840
debug('comparator trim', range)
88408841

88418842
// `~ 1.2.3` => `~1.2.3`
88428843
range = range.replace(re[t.TILDETRIM], tildeTrimReplace)
8844+
debug('tilde trim', range)
88438845

88448846
// `^ 1.2.3` => `^1.2.3`
88458847
range = range.replace(re[t.CARETTRIM], caretTrimReplace)
8848+
debug('caret trim', range)
88468849

88478850
// At this point, the range is completely trimmed and
88488851
// ready to be split into comparators.
@@ -10144,6 +10147,10 @@ const MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER ||
1014410147
// Max safe segment length for coercion.
1014510148
const MAX_SAFE_COMPONENT_LENGTH = 16
1014610149

10150+
// Max safe length for a build identifier. The max length minus 6 characters for
10151+
// the shortest version with a build 0.0.0+BUILD.
10152+
const MAX_SAFE_BUILD_LENGTH = MAX_LENGTH - 6
10153+
1014710154
const RELEASE_TYPES = [
1014810155
'major',
1014910156
'premajor',
@@ -10157,6 +10164,7 @@ const RELEASE_TYPES = [
1015710164
module.exports = {
1015810165
MAX_LENGTH,
1015910166
MAX_SAFE_COMPONENT_LENGTH,
10167+
MAX_SAFE_BUILD_LENGTH,
1016010168
MAX_SAFE_INTEGER,
1016110169
RELEASE_TYPES,
1016210170
SEMVER_SPEC_VERSION,
@@ -10238,7 +10246,7 @@ module.exports = parseOptions
1023810246
/***/ 9523:
1023910247
/***/ ((module, exports, __nccwpck_require__) => {
1024010248

10241-
const { MAX_SAFE_COMPONENT_LENGTH } = __nccwpck_require__(2293)
10249+
const { MAX_SAFE_COMPONENT_LENGTH, MAX_SAFE_BUILD_LENGTH } = __nccwpck_require__(2293)
1024210250
const debug = __nccwpck_require__(427)
1024310251
exports = module.exports = {}
1024410252

@@ -10249,16 +10257,31 @@ const src = exports.src = []
1024910257
const t = exports.t = {}
1025010258
let R = 0
1025110259

10260+
const LETTERDASHNUMBER = '[a-zA-Z0-9-]'
10261+
10262+
// Replace some greedy regex tokens to prevent regex dos issues. These regex are
10263+
// used internally via the safeRe object since all inputs in this library get
10264+
// normalized first to trim and collapse all extra whitespace. The original
10265+
// regexes are exported for userland consumption and lower level usage. A
10266+
// future breaking change could export the safer regex only with a note that
10267+
// all input should have extra whitespace removed.
10268+
const safeRegexReplacements = [
10269+
['\\s', 1],
10270+
['\\d', MAX_SAFE_COMPONENT_LENGTH],
10271+
[LETTERDASHNUMBER, MAX_SAFE_BUILD_LENGTH],
10272+
]
10273+
10274+
const makeSafeRegex = (value) => {
10275+
for (const [token, max] of safeRegexReplacements) {
10276+
value = value
10277+
.split(`${token}*`).join(`${token}{0,${max}}`)
10278+
.split(`${token}+`).join(`${token}{1,${max}}`)
10279+
}
10280+
return value
10281+
}
10282+
1025210283
const createToken = (name, value, isGlobal) => {
10253-
// Replace all greedy whitespace to prevent regex dos issues. These regex are
10254-
// used internally via the safeRe object since all inputs in this library get
10255-
// normalized first to trim and collapse all extra whitespace. The original
10256-
// regexes are exported for userland consumption and lower level usage. A
10257-
// future breaking change could export the safer regex only with a note that
10258-
// all input should have extra whitespace removed.
10259-
const safe = value
10260-
.split('\\s*').join('\\s{0,1}')
10261-
.split('\\s+').join('\\s')
10284+
const safe = makeSafeRegex(value)
1026210285
const index = R++
1026310286
debug(name, index, value)
1026410287
t[name] = index
@@ -10274,13 +10297,13 @@ const createToken = (name, value, isGlobal) => {
1027410297
// A single `0`, or a non-zero digit followed by zero or more digits.
1027510298

1027610299
createToken('NUMERICIDENTIFIER', '0|[1-9]\\d*')
10277-
createToken('NUMERICIDENTIFIERLOOSE', '[0-9]+')
10300+
createToken('NUMERICIDENTIFIERLOOSE', '\\d+')
1027810301

1027910302
// ## Non-numeric Identifier
1028010303
// Zero or more digits, followed by a letter or hyphen, and then zero or
1028110304
// more letters, digits, or hyphens.
1028210305

10283-
createToken('NONNUMERICIDENTIFIER', '\\d*[a-zA-Z-][a-zA-Z0-9-]*')
10306+
createToken('NONNUMERICIDENTIFIER', `\\d*[a-zA-Z-]${LETTERDASHNUMBER}*`)
1028410307

1028510308
// ## Main Version
1028610309
// Three dot-separated numeric identifiers.
@@ -10315,7 +10338,7 @@ createToken('PRERELEASELOOSE', `(?:-?(${src[t.PRERELEASEIDENTIFIERLOOSE]
1031510338
// ## Build Metadata Identifier
1031610339
// Any combination of digits, letters, or hyphens.
1031710340

10318-
createToken('BUILDIDENTIFIER', '[0-9A-Za-z-]+')
10341+
createToken('BUILDIDENTIFIER', `${LETTERDASHNUMBER}+`)
1031910342

1032010343
// ## Build Metadata
1032110344
// Plus sign, followed by one or more period-separated build metadata

package-lock.json

+4-4
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@
2424
"dependencies": {
2525
"@actions/core": "^1.10.0",
2626
"@actions/exec": "^1.1.1",
27-
"@actions/tool-cache": "^1.7.2",
2827
"@actions/io": "^1.1.3",
29-
"semver": "^7.5.2",
28+
"@actions/tool-cache": "^1.7.2",
29+
"semver": "^7.5.3",
3030
"typed-rest-client": "^1.8.9"
3131
},
3232
"devDependencies": {

0 commit comments

Comments
 (0)