Skip to content

Commit 4ac24ef

Browse files
authored
Merge pull request #348 from arduino/dependabot/npm_and_yarn/semver-7.6.0
Bump semver from 7.5.4 to 7.6.0
2 parents 6886aea + cfe3923 commit 4ac24ef

File tree

3 files changed

+28
-15
lines changed

3 files changed

+28
-15
lines changed

dist/index.js

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

94059405
let match = null
94069406
if (!options.rtl) {
9407-
match = version.match(re[t.COERCE])
9407+
match = version.match(options.includePrerelease ? re[t.COERCEFULL] : re[t.COERCE])
94089408
} else {
94099409
// Find the right-most coercible string that does not share
94109410
// a terminus with a more left-ward coercible string.
94119411
// Eg, '1.2.3.4' wants to coerce '2.3.4', not '3.4' or '4'
9412+
// With includePrerelease option set, '1.2.3.4-rc' wants to coerce '2.3.4-rc', not '2.3.4'
94129413
//
94139414
// Walk through the string checking with a /g regexp
94149415
// Manually set the index so as to pick up overlapping matches.
94159416
// Stop when we get a match that ends at the string end, since no
94169417
// coercible string can be more right-ward without the same terminus.
9418+
const coerceRtlRegex = options.includePrerelease ? re[t.COERCERTLFULL] : re[t.COERCERTL]
94179419
let next
9418-
while ((next = re[t.COERCERTL].exec(version)) &&
9420+
while ((next = coerceRtlRegex.exec(version)) &&
94199421
(!match || match.index + match[0].length !== version.length)
94209422
) {
94219423
if (!match ||
94229424
next.index + next[0].length !== match.index + match[0].length) {
94239425
match = next
94249426
}
9425-
re[t.COERCERTL].lastIndex = next.index + next[1].length + next[2].length
9427+
coerceRtlRegex.lastIndex = next.index + next[1].length + next[2].length
94269428
}
94279429
// leave it in a clean state
9428-
re[t.COERCERTL].lastIndex = -1
9430+
coerceRtlRegex.lastIndex = -1
94299431
}
94309432

94319433
if (match === null) {
94329434
return null
94339435
}
94349436

9435-
return parse(`${match[2]}.${match[3] || '0'}.${match[4] || '0'}`, options)
9437+
const major = match[2]
9438+
const minor = match[3] || '0'
9439+
const patch = match[4] || '0'
9440+
const prerelease = options.includePrerelease && match[5] ? `-${match[5]}` : ''
9441+
const build = options.includePrerelease && match[6] ? `+${match[6]}` : ''
9442+
9443+
return parse(`${major}.${minor}.${patch}${prerelease}${build}`, options)
94369444
}
94379445
module.exports = coerce
94389446

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

1012510133
// Coercion.
1012610134
// Extract anything that could conceivably be a part of a valid semver
10127-
createToken('COERCE', `${'(^|[^\\d])' +
10135+
createToken('COERCEPLAIN', `${'(^|[^\\d])' +
1012810136
'(\\d{1,'}${MAX_SAFE_COMPONENT_LENGTH}})` +
1012910137
`(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?` +
10130-
`(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?` +
10138+
`(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?`)
10139+
createToken('COERCE', `${src[t.COERCEPLAIN]}(?:$|[^\\d])`)
10140+
createToken('COERCEFULL', src[t.COERCEPLAIN] +
10141+
`(?:${src[t.PRERELEASE]})?` +
10142+
`(?:${src[t.BUILD]})?` +
1013110143
`(?:$|[^\\d])`)
1013210144
createToken('COERCERTL', src[t.COERCE], true)
10145+
createToken('COERCERTLFULL', src[t.COERCEFULL], true)
1013310146

1013410147
// Tilde ranges.
1013510148
// 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
@@ -25,7 +25,7 @@
2525
"@actions/core": "^1.10.1",
2626
"@actions/http-client": "^2.2.0",
2727
"@actions/tool-cache": "^2.0.1",
28-
"semver": "^7.5.4"
28+
"semver": "^7.6.0"
2929
},
3030
"devDependencies": {
3131
"@actions/io": "^1.1.3",

0 commit comments

Comments
 (0)