From cad73bed172c6804eb9fa5fd8b21b759f53d6991 Mon Sep 17 00:00:00 2001 From: Chris Duncan Date: Tue, 26 Nov 2024 13:41:13 -0800 Subject: [PATCH] Clarify array typings. --- src/lib/convert.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lib/convert.ts b/src/lib/convert.ts index 630b894..41bb662 100644 --- a/src/lib/convert.ts +++ b/src/lib/convert.ts @@ -45,7 +45,7 @@ export const bin = { * @returns {Uint8Array} Byte array representation of the input string */ toBytes (bin: string): Uint8Array { - const bytes = [] + const bytes: number[] = [] while (bin.length > 0) { const bits = bin.substring(0, 8) bytes.push(parseInt(bits, 2)) @@ -222,7 +222,7 @@ export const dec = { throw new TypeError('Invalid padding') } let integer = BigInt(decimal) - const bytes = [] + const bytes: number[] = [] while (integer > 0) { const lsb = BigInt.asUintN(8, integer) bytes.push(Number(lsb)) -- 2.34.1