docs(calculate-version): 重建 README、修正 compareVersionArrays JSDoc 並更新指令檔註解日期
CI / Release Tag Version (pull_request) Successful in 4s
CI / Calculate Version (pull_request) Successful in 27s

This commit is contained in:
Jeffery
2026-06-30 17:43:09 +08:00
parent 7f3ddf62e3
commit 7de0900d5f
7 changed files with 19 additions and 18 deletions
+2 -1
View File
@@ -9,7 +9,8 @@ const SEGMENT_LIMIT = 10;
* @param {number[]} b - 第二個版本號區段陣列,例如 [1, 2, 0]。
* @returns {number} 大於 0 表示 a 大於 b;小於 0 表示 a 小於 b;0 表示兩者相等。
* 相異區段回傳的是該段差值(非固定 ±1)。
* @throws {TypeError} 當 a 或 b 非陣列(無 length 屬性)時拋出
* @throws {TypeError} 當 a 或 b 為 null/undefined(讀取 .length 即報錯)時拋出
* 傳入「有 length 但非數值陣列」(如字串)不會拋例外,但會得到非預期結果。
*/
function compareVersionArrays(a, b) {
const length = Math.max(a.length, b.length);