npm-pkg-lint 5.1.5 → 5.1.7
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 +6 -2
- package/dist/index.js.map +3 -3
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -4687,6 +4687,7 @@ var require_range = __commonJS({
|
|
|
4687
4687
|
return comp;
|
|
4688
4688
|
};
|
|
4689
4689
|
var isX = (id) => !id || id.toLowerCase() === "x" || id === "*";
|
|
4690
|
+
var invalidXRangeOrder = (M2, m2, p2) => isX(M2) && !isX(m2) || isX(m2) && p2 && !isX(p2);
|
|
4690
4691
|
var replaceTildes = (comp, options) => {
|
|
4691
4692
|
return comp.trim().split(/\s+/).map((c) => replaceTilde(c, options)).join(" ");
|
|
4692
4693
|
};
|
|
@@ -4746,9 +4747,9 @@ var require_range = __commonJS({
|
|
|
4746
4747
|
debug("no pr");
|
|
4747
4748
|
if (M2 === "0") {
|
|
4748
4749
|
if (m2 === "0") {
|
|
4749
|
-
ret = `>=${M2}.${m2}.${p2}
|
|
4750
|
+
ret = `>=${M2}.${m2}.${p2} <${M2}.${m2}.${+p2 + 1}-0`;
|
|
4750
4751
|
} else {
|
|
4751
|
-
ret = `>=${M2}.${m2}.${p2}
|
|
4752
|
+
ret = `>=${M2}.${m2}.${p2} <${M2}.${+m2 + 1}.0-0`;
|
|
4752
4753
|
}
|
|
4753
4754
|
} else {
|
|
4754
4755
|
ret = `>=${M2}.${m2}.${p2} <${+M2 + 1}.0.0-0`;
|
|
@@ -4767,6 +4768,9 @@ var require_range = __commonJS({
|
|
|
4767
4768
|
const r = options.loose ? re2[t.XRANGELOOSE] : re2[t.XRANGE];
|
|
4768
4769
|
return comp.replace(r, (ret, gtlt, M2, m2, p2, pr2) => {
|
|
4769
4770
|
debug("xRange", comp, ret, gtlt, M2, m2, p2, pr2);
|
|
4771
|
+
if (invalidXRangeOrder(M2, m2, p2)) {
|
|
4772
|
+
return comp;
|
|
4773
|
+
}
|
|
4770
4774
|
const xM = isX(M2);
|
|
4771
4775
|
const xm = xM || isX(m2);
|
|
4772
4776
|
const xp = xm || isX(p2);
|