From: Chris Duncan Date: Fri, 16 Oct 2026 18:45:13 +0000 (-0700) Subject: Allow zero at first so proper error message is returned. X-Git-Tag: v2.0.0~1^2~10 X-Git-Url: https://git.codecow.com/?a=commitdiff_plain;h=c1003177d2e7650975539fe9134a7e59ecb4f22e;p=nano25519.git Allow zero at first so proper error message is returned. --- diff --git a/src/lib/verify.ts b/src/lib/verify.ts index 48ad7b9..eb75e0d 100644 --- a/src/lib/verify.ts +++ b/src/lib/verify.ts @@ -32,7 +32,7 @@ export function verify (sig: unknown, msg: unknown, pub: unknown): boolean { export function verify_blocks (pub: unknown, data: unknown): readonly boolean[] { const blocks: unknown[] = isArray(data) ? data : [data] const count: unknown = blocks.length - if (typeof count !== 'number' || !count || count === Infinity || count === -Infinity) { + if (typeof count !== 'number' || count !== count || count === Infinity || count === -Infinity) { throw new Nano25519TypeError('Invalid blocks length', { cause: data }) } if (count < 1) {