Skip to content

Commit 1553e9a

Browse files
authored
Merge pull request #931 from arduino/dependabot/npm_and_yarn/semver-7.6.0
build(deps): bump semver from 7.5.4 to 7.6.0
2 parents 59a575b + cd52986 commit 1553e9a

File tree

4 files changed

+29
-16
lines changed

4 files changed

+29
-16
lines changed

.licenses/npm/semver-7.5.4.dep.yml renamed to .licenses/npm/semver-7.6.0.dep.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
name: semver
3-
version: 7.5.4
3+
version: 7.6.0
44
type: npm
55
summary: The semantic version parser used by npm.
66
homepage:

dist/index.js

Lines changed: 20 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9957,35 +9957,43 @@ const coerce = (version, options) => {
99579957

99589958
let match = null
99599959
if (!options.rtl) {
9960-
match = version.match(re[t.COERCE])
9960+
match = version.match(options.includePrerelease ? re[t.COERCEFULL] : re[t.COERCE])
99619961
} else {
99629962
// Find the right-most coercible string that does not share
99639963
// a terminus with a more left-ward coercible string.
99649964
// Eg, '1.2.3.4' wants to coerce '2.3.4', not '3.4' or '4'
9965+
// With includePrerelease option set, '1.2.3.4-rc' wants to coerce '2.3.4-rc', not '2.3.4'
99659966
//
99669967
// Walk through the string checking with a /g regexp
99679968
// Manually set the index so as to pick up overlapping matches.
99689969
// Stop when we get a match that ends at the string end, since no
99699970
// coercible string can be more right-ward without the same terminus.
9971+
const coerceRtlRegex = options.includePrerelease ? re[t.COERCERTLFULL] : re[t.COERCERTL]
99709972
let next
9971-
while ((next = re[t.COERCERTL].exec(version)) &&
9973+
while ((next = coerceRtlRegex.exec(version)) &&
99729974
(!match || match.index + match[0].length !== version.length)
99739975
) {
99749976
if (!match ||
99759977
next.index + next[0].length !== match.index + match[0].length) {
99769978
match = next
99779979
}
9978-
re[t.COERCERTL].lastIndex = next.index + next[1].length + next[2].length
9980+
coerceRtlRegex.lastIndex = next.index + next[1].length + next[2].length
99799981
}
99809982
// leave it in a clean state
9981-
re[t.COERCERTL].lastIndex = -1
9983+
coerceRtlRegex.lastIndex = -1
99829984
}
99839985

99849986
if (match === null) {
99859987
return null
99869988
}
99879989

9988-
return parse(`${match[2]}.${match[3] || '0'}.${match[4] || '0'}`, options)
9990+
const major = match[2]
9991+
const minor = match[3] || '0'
9992+
const patch = match[4] || '0'
9993+
const prerelease = options.includePrerelease && match[5] ? `-${match[5]}` : ''
9994+
const build = options.includePrerelease && match[6] ? `+${match[6]}` : ''
9995+
9996+
return parse(`${major}.${minor}.${patch}${prerelease}${build}`, options)
99899997
}
99909998
module.exports = coerce
99919999

@@ -10677,12 +10685,17 @@ createToken('XRANGELOOSE', `^${src[t.GTLT]}\\s*${src[t.XRANGEPLAINLOOSE]}$`)
1067710685

1067810686
// Coercion.
1067910687
// Extract anything that could conceivably be a part of a valid semver
10680-
createToken('COERCE', `${'(^|[^\\d])' +
10688+
createToken('COERCEPLAIN', `${'(^|[^\\d])' +
1068110689
'(\\d{1,'}${MAX_SAFE_COMPONENT_LENGTH}})` +
1068210690
`(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?` +
10683-
`(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?` +
10691+
`(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?`)
10692+
createToken('COERCE', `${src[t.COERCEPLAIN]}(?:$|[^\\d])`)
10693+
createToken('COERCEFULL', src[t.COERCEPLAIN] +
10694+
`(?:${src[t.PRERELEASE]})?` +
10695+
`(?:${src[t.BUILD]})?` +
1068410696
`(?:$|[^\\d])`)
1068510697
createToken('COERCERTL', src[t.COERCE], true)
10698+
createToken('COERCERTLFULL', src[t.COERCEFULL], true)
1068610699

1068710700
// Tilde ranges.
1068810701
// Meaning is "reasonably at or greater than"

package-lock.json

Lines changed: 7 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
"dependencies": {
1919
"@actions/core": "^1.10.1",
2020
"@actions/tool-cache": "^2.0.1",
21-
"semver": "^7.5.4",
21+
"semver": "^7.6.0",
2222
"typed-rest-client": "^1.8.11"
2323
},
2424
"devDependencies": {

0 commit comments

Comments
 (0)