zarro 1.170.16 → 1.170.18

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.
@@ -67,7 +67,7 @@
67
67
  const ver = other instanceof Version
68
68
  ? other
69
69
  : new Version(other);
70
- return compareVersionArrays(this.version, ver.version);
70
+ return compareVersions(this.version, this.tag, ver.version, ver.tag);
71
71
  }
72
72
  toString() {
73
73
  const ver = this.version.join(".");
@@ -76,7 +76,7 @@
76
76
  : ver;
77
77
  }
78
78
  }
79
- function compareVersionArrays(x, y) {
79
+ function compareVersions(x, xTag, y, yTag) {
80
80
  const shortest = Math.min(x.length, y.length), compare = [];
81
81
  for (let i = 0; i < shortest; i++) {
82
82
  if (x[i] > y[i]) {
@@ -90,11 +90,11 @@
90
90
  }
91
91
  }
92
92
  if (compare.length === 0) {
93
- return 0;
93
+ return compareTags(xTag, yTag);
94
94
  }
95
95
  const allZero = compare.reduce((acc, cur) => acc && (cur === "0"), true);
96
96
  if (allZero) {
97
- return 0;
97
+ return compareTags(xTag, yTag);
98
98
  }
99
99
  for (const s of compare) {
100
100
  if (s === ">") {
@@ -104,7 +104,29 @@
104
104
  return -1;
105
105
  }
106
106
  }
107
+ return compareTags(xTag, yTag);
108
+ }
109
+ function compareTags(xTag, yTag) {
110
+ if (xTag && yTag) {
111
+ return compareStrings(xTag, yTag);
112
+ }
113
+ if (xTag) {
114
+ // assume x is the beta for y
115
+ return -1;
116
+ }
117
+ if (yTag) {
118
+ // assume y is the beta for x
119
+ return 1;
120
+ }
107
121
  return 0;
108
122
  }
123
+ function compareStrings(s1, s2) {
124
+ if (s1 === s2) {
125
+ return 0;
126
+ }
127
+ return s1 < s2
128
+ ? -1
129
+ : 1;
130
+ }
109
131
  module.exports = Version;
110
132
  })();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zarro",
3
- "version": "1.170.16",
3
+ "version": "1.170.18",
4
4
  "description": "Some glue to make gulp easier, perhaps even zero- or close-to-zero-conf",
5
5
  "bin": {
6
6
  "zarro": "./index.js"
package/types.d.ts CHANGED
@@ -1510,6 +1510,7 @@ declare global {
1510
1510
  exactMatch?: boolean;
1511
1511
  preRelease?: boolean;
1512
1512
  configFile?: string;
1513
+ latestOnly?: boolean;
1513
1514
  }
1514
1515
 
1515
1516
  interface DotNetInstallNugetPackageOption extends DotNetBaseOptions {