npm-pkg-lint 3.10.7 → 3.10.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +21 -8
- package/dist/index.js.map +3 -3
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -3841,6 +3841,17 @@ var require_semver = __commonJS({
|
|
|
3841
3841
|
// preminor will bump the version up to the next minor release, and immediately
|
|
3842
3842
|
// down to pre-release. premajor and prepatch work the same way.
|
|
3843
3843
|
inc(release, identifier, identifierBase) {
|
|
3844
|
+
if (release.startsWith("pre")) {
|
|
3845
|
+
if (!identifier && identifierBase === false) {
|
|
3846
|
+
throw new Error("invalid increment argument: identifier is empty");
|
|
3847
|
+
}
|
|
3848
|
+
if (identifier) {
|
|
3849
|
+
const match2 = `-${identifier}`.match(this.options.loose ? re[t.PRERELEASELOOSE] : re[t.PRERELEASE]);
|
|
3850
|
+
if (!match2 || match2[1] !== identifier) {
|
|
3851
|
+
throw new Error(`invalid identifier: ${identifier}`);
|
|
3852
|
+
}
|
|
3853
|
+
}
|
|
3854
|
+
}
|
|
3844
3855
|
switch (release) {
|
|
3845
3856
|
case "premajor":
|
|
3846
3857
|
this.prerelease.length = 0;
|
|
@@ -3868,6 +3879,12 @@ var require_semver = __commonJS({
|
|
|
3868
3879
|
}
|
|
3869
3880
|
this.inc("pre", identifier, identifierBase);
|
|
3870
3881
|
break;
|
|
3882
|
+
case "release":
|
|
3883
|
+
if (this.prerelease.length === 0) {
|
|
3884
|
+
throw new Error(`version ${this.raw} is not a prerelease`);
|
|
3885
|
+
}
|
|
3886
|
+
this.prerelease.length = 0;
|
|
3887
|
+
break;
|
|
3871
3888
|
case "major":
|
|
3872
3889
|
if (this.minor !== 0 || this.patch !== 0 || this.prerelease.length === 0) {
|
|
3873
3890
|
this.major++;
|
|
@@ -3893,9 +3910,6 @@ var require_semver = __commonJS({
|
|
|
3893
3910
|
// 1.0.0 'pre' would become 1.0.0-0 which is the wrong direction.
|
|
3894
3911
|
case "pre": {
|
|
3895
3912
|
const base = Number(identifierBase) ? 1 : 0;
|
|
3896
|
-
if (!identifier && identifierBase === false) {
|
|
3897
|
-
throw new Error("invalid increment argument: identifier is empty");
|
|
3898
|
-
}
|
|
3899
3913
|
if (this.prerelease.length === 0) {
|
|
3900
3914
|
this.prerelease = [base];
|
|
3901
3915
|
} else {
|
|
@@ -4030,13 +4044,12 @@ var require_diff = __commonJS({
|
|
|
4030
4044
|
if (!lowVersion.patch && !lowVersion.minor) {
|
|
4031
4045
|
return "major";
|
|
4032
4046
|
}
|
|
4033
|
-
if (highVersion
|
|
4047
|
+
if (lowVersion.compareMain(highVersion) === 0) {
|
|
4048
|
+
if (lowVersion.minor && !lowVersion.patch) {
|
|
4049
|
+
return "minor";
|
|
4050
|
+
}
|
|
4034
4051
|
return "patch";
|
|
4035
4052
|
}
|
|
4036
|
-
if (highVersion.minor) {
|
|
4037
|
-
return "minor";
|
|
4038
|
-
}
|
|
4039
|
-
return "major";
|
|
4040
4053
|
}
|
|
4041
4054
|
const prefix2 = highHasPre ? "pre" : "";
|
|
4042
4055
|
if (v1.major !== v2.major) {
|