Skip to content

Commit 3a10bc3

Browse files
authored
Merge pull request #453 from arduino/dependabot/npm_and_yarn/semver-7.7.0
Bump semver from 7.6.3 to 7.7.0
2 parents 4730a39 + 2c8b9e0 commit 3a10bc3

File tree

4 files changed

+32
-24
lines changed

4 files changed

+32
-24
lines changed

.licenses/npm/semver-7.6.3.dep.yml renamed to .licenses/npm/semver-7.7.0.dep.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
---
22
name: semver
3-
version: 7.6.3
3+
version: 7.7.0
44
type: npm
55
summary: The semantic version parser used by npm.
6-
homepage:
76
license: isc
87
licenses:
98
- sources: LICENSE

dist/index.js

Lines changed: 25 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -8226,7 +8226,7 @@ class SemVer {
82268226

82278227
if (version instanceof SemVer) {
82288228
if (version.loose === !!options.loose &&
8229-
version.includePrerelease === !!options.includePrerelease) {
8229+
version.includePrerelease === !!options.includePrerelease) {
82308230
return version
82318231
} else {
82328232
version = version.version
@@ -8392,6 +8392,19 @@ class SemVer {
83928392
// preminor will bump the version up to the next minor release, and immediately
83938393
// down to pre-release. premajor and prepatch work the same way.
83948394
inc (release, identifier, identifierBase) {
8395+
if (release.startsWith('pre')) {
8396+
if (!identifier && identifierBase === false) {
8397+
throw new Error('invalid increment argument: identifier is empty')
8398+
}
8399+
// Avoid an invalid semver results
8400+
if (identifier) {
8401+
const match = `-${identifier}`.match(this.options.loose ? re[t.PRERELEASELOOSE] : re[t.PRERELEASE])
8402+
if (!match || match[1] !== identifier) {
8403+
throw new Error(`invalid identifier: ${identifier}`)
8404+
}
8405+
}
8406+
}
8407+
83958408
switch (release) {
83968409
case 'premajor':
83978410
this.prerelease.length = 0
@@ -8422,6 +8435,12 @@ class SemVer {
84228435
}
84238436
this.inc('pre', identifier, identifierBase)
84248437
break
8438+
case 'release':
8439+
if (this.prerelease.length === 0) {
8440+
throw new Error(`version ${this.raw} is not a prerelease`)
8441+
}
8442+
this.prerelease.length = 0
8443+
break
84258444

84268445
case 'major':
84278446
// If this is a pre-major version, bump up to the same major version.
@@ -8465,10 +8484,6 @@ class SemVer {
84658484
case 'pre': {
84668485
const base = Number(identifierBase) ? 1 : 0
84678486

8468-
if (!identifier && identifierBase === false) {
8469-
throw new Error('invalid increment argument: identifier is empty')
8470-
}
8471-
84728487
if (this.prerelease.length === 0) {
84738488
this.prerelease = [base]
84748489
} else {
@@ -8727,20 +8742,13 @@ const diff = (version1, version2) => {
87278742
return 'major'
87288743
}
87298744

8730-
// Otherwise it can be determined by checking the high version
8731-
8732-
if (highVersion.patch) {
8733-
// anything higher than a patch bump would result in the wrong version
8745+
// If the main part has no difference
8746+
if (lowVersion.compareMain(highVersion) === 0) {
8747+
if (lowVersion.minor && !lowVersion.patch) {
8748+
return 'minor'
8749+
}
87348750
return 'patch'
87358751
}
8736-
8737-
if (highVersion.minor) {
8738-
// anything higher than a minor bump would result in the wrong version
8739-
return 'minor'
8740-
}
8741-
8742-
// bumping major/minor/patch all have same result
8743-
return 'major'
87448752
}
87458753

87468754
// add the `pre` prefix if we are going to a prerelease version

package-lock.json

Lines changed: 5 additions & 4 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
"@actions/core": "^1.11.1",
1919
"@actions/http-client": "^2.2.3",
2020
"@actions/tool-cache": "^2.0.2",
21-
"semver": "^7.6.3"
21+
"semver": "^7.7.0"
2222
},
2323
"devDependencies": {
2424
"@actions/io": "^1.1.3",

0 commit comments

Comments
 (0)