docs(calculate-version): 重建 README、修正 compareVersionArrays JSDoc 並更新指令檔註解日期
This commit is contained in:
+2
-1
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user