dsh-agentone 0.5.8 → 0.5.9
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/lib/proc.js +3 -2
- package/package.json +1 -1
package/lib/proc.js
CHANGED
|
@@ -74,8 +74,9 @@ export function parseLatestVersionLine(stdout) {
|
|
|
74
74
|
export function compareSemver(a, b) {
|
|
75
75
|
const parse = (v) => {
|
|
76
76
|
const [core, pre] = String(v).split('+')[0].split('-');
|
|
77
|
-
const
|
|
78
|
-
|
|
77
|
+
const raw = core.split('.').map((n) => parseInt(n, 10) || 0);
|
|
78
|
+
while (raw.length < 3) raw.push(0); // 「1.2」补齐为「1.2.0」再比
|
|
79
|
+
return { nums: raw, pre: pre === undefined ? null : pre.split('.') };
|
|
79
80
|
};
|
|
80
81
|
const pa = parse(a);
|
|
81
82
|
const pb = parse(b);
|
package/package.json
CHANGED