Skip to content

Commit a13808e

Browse files
committed
deps: semver@7.6.0
1 parent d6521ac commit a13808e

File tree

5 files changed

+56
-25
lines changed

5 files changed

+56
-25
lines changed

node_modules/semver/functions/coerce.js

+13-5
Original file line numberDiff line numberDiff line change
@@ -19,34 +19,42 @@ const coerce = (version, options) => {
1919

2020
let match = null
2121
if (!options.rtl) {
22-
match = version.match(re[t.COERCE])
22+
match = version.match(options.includePrerelease ? re[t.COERCEFULL] : re[t.COERCE])
2323
} else {
2424
// Find the right-most coercible string that does not share
2525
// a terminus with a more left-ward coercible string.
2626
// Eg, '1.2.3.4' wants to coerce '2.3.4', not '3.4' or '4'
27+
// With includePrerelease option set, '1.2.3.4-rc' wants to coerce '2.3.4-rc', not '2.3.4'
2728
//
2829
// Walk through the string checking with a /g regexp
2930
// Manually set the index so as to pick up overlapping matches.
3031
// Stop when we get a match that ends at the string end, since no
3132
// coercible string can be more right-ward without the same terminus.
33+
const coerceRtlRegex = options.includePrerelease ? re[t.COERCERTLFULL] : re[t.COERCERTL]
3234
let next
33-
while ((next = re[t.COERCERTL].exec(version)) &&
35+
while ((next = coerceRtlRegex.exec(version)) &&
3436
(!match || match.index + match[0].length !== version.length)
3537
) {
3638
if (!match ||
3739
next.index + next[0].length !== match.index + match[0].length) {
3840
match = next
3941
}
40-
re[t.COERCERTL].lastIndex = next.index + next[1].length + next[2].length
42+
coerceRtlRegex.lastIndex = next.index + next[1].length + next[2].length
4143
}
4244
// leave it in a clean state
43-
re[t.COERCERTL].lastIndex = -1
45+
coerceRtlRegex.lastIndex = -1
4446
}
4547

4648
if (match === null) {
4749
return null
4850
}
4951

50-
return parse(`${match[2]}.${match[3] || '0'}.${match[4] || '0'}`, options)
52+
const major = match[2]
53+
const minor = match[3] || '0'
54+
const patch = match[4] || '0'
55+
const prerelease = options.includePrerelease && match[5] ? `-${match[5]}` : ''
56+
const build = options.includePrerelease && match[6] ? `+${match[6]}` : ''
57+
58+
return parse(`${major}.${minor}.${patch}${prerelease}${build}`, options)
5159
}
5260
module.exports = coerce

node_modules/semver/internal/re.js

+7-2
Original file line numberDiff line numberDiff line change
@@ -154,12 +154,17 @@ createToken('XRANGELOOSE', `^${src[t.GTLT]}\\s*${src[t.XRANGEPLAINLOOSE]}$`)
154154

155155
// Coercion.
156156
// Extract anything that could conceivably be a part of a valid semver
157-
createToken('COERCE', `${'(^|[^\\d])' +
157+
createToken('COERCEPLAIN', `${'(^|[^\\d])' +
158158
'(\\d{1,'}${MAX_SAFE_COMPONENT_LENGTH}})` +
159159
`(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?` +
160-
`(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?` +
160+
`(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?`)
161+
createToken('COERCE', `${src[t.COERCEPLAIN]}(?:$|[^\\d])`)
162+
createToken('COERCEFULL', src[t.COERCEPLAIN] +
163+
`(?:${src[t.PRERELEASE]})?` +
164+
`(?:${src[t.BUILD]})?` +
161165
`(?:$|[^\\d])`)
162166
createToken('COERCERTL', src[t.COERCE], true)
167+
createToken('COERCERTLFULL', src[t.COERCEFULL], true)
163168

164169
// Tilde ranges.
165170
// Meaning is "reasonably at or greater than"

node_modules/semver/package.json

+4-13
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
11
{
22
"name": "semver",
3-
"version": "7.5.4",
3+
"version": "7.6.0",
44
"description": "The semantic version parser used by npm.",
55
"main": "index.js",
66
"scripts": {
77
"test": "tap",
88
"snap": "tap",
9-
"lint": "eslint \"**/*.js\"",
9+
"lint": "eslint \"**/*.{js,cjs,ts,mjs,jsx,tsx}\"",
1010
"postlint": "template-oss-check",
1111
"lintfix": "npm run lint -- --fix",
1212
"posttest": "npm run lint",
1313
"template-oss-apply": "template-oss-apply --force"
1414
},
1515
"devDependencies": {
1616
"@npmcli/eslint-config": "^4.0.0",
17-
"@npmcli/template-oss": "4.17.0",
17+
"@npmcli/template-oss": "4.21.3",
1818
"tap": "^16.0.0"
1919
},
2020
"license": "ISC",
@@ -53,17 +53,8 @@
5353
"author": "GitHub Inc.",
5454
"templateOSS": {
5555
"//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.",
56-
"version": "4.17.0",
56+
"version": "4.21.3",
5757
"engines": ">=10",
58-
"ciVersions": [
59-
"10.0.0",
60-
"10.x",
61-
"12.x",
62-
"14.x",
63-
"16.x",
64-
"18.x"
65-
],
66-
"npmSpec": "8",
6758
"distPaths": [
6859
"classes/",
6960
"functions/",

package-lock.json

+31-4
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@
147147
"proc-log": "^3.0.0",
148148
"qrcode-terminal": "^0.12.0",
149149
"read": "^2.1.0",
150-
"semver": "^7.5.4",
150+
"semver": "^7.6.0",
151151
"spdx-expression-parse": "^3.0.1",
152152
"ssri": "^10.0.5",
153153
"supports-color": "^9.4.0",
@@ -916,6 +916,33 @@
916916
"node": ">=v18"
917917
}
918918
},
919+
"node_modules/@commitlint/is-ignored/node_modules/lru-cache": {
920+
"version": "6.0.0",
921+
"resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz",
922+
"integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==",
923+
"dev": true,
924+
"dependencies": {
925+
"yallist": "^4.0.0"
926+
},
927+
"engines": {
928+
"node": ">=10"
929+
}
930+
},
931+
"node_modules/@commitlint/is-ignored/node_modules/semver": {
932+
"version": "7.5.4",
933+
"resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz",
934+
"integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==",
935+
"dev": true,
936+
"dependencies": {
937+
"lru-cache": "^6.0.0"
938+
},
939+
"bin": {
940+
"semver": "bin/semver.js"
941+
},
942+
"engines": {
943+
"node": ">=10"
944+
}
945+
},
919946
"node_modules/@commitlint/lint": {
920947
"version": "18.4.4",
921948
"resolved": "https://registry.npmjs.org/@commitlint/lint/-/lint-18.4.4.tgz",
@@ -11985,9 +12012,9 @@
1198512012
}
1198612013
},
1198712014
"node_modules/semver": {
11988-
"version": "7.5.4",
11989-
"resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz",
11990-
"integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==",
12015+
"version": "7.6.0",
12016+
"resolved": "https://registry.npmjs.org/semver/-/semver-7.6.0.tgz",
12017+
"integrity": "sha512-EnwXhrlwXMk9gKu5/flx5sv/an57AkRplG3hTK68W7FRDN+k+OWBj65M7719OkA82XLBxrcX0KSHj+X5COhOVg==",
1199112018
"inBundle": true,
1199212019
"dependencies": {
1199312020
"lru-cache": "^6.0.0"

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@
110110
"proc-log": "^3.0.0",
111111
"qrcode-terminal": "^0.12.0",
112112
"read": "^2.1.0",
113-
"semver": "^7.5.4",
113+
"semver": "^7.6.0",
114114
"spdx-expression-parse": "^3.0.1",
115115
"ssri": "^10.0.5",
116116
"supports-color": "^9.4.0",

0 commit comments

Comments
 (0)