From: Chris Duncan Date: Tue, 19 Aug 2025 18:12:51 +0000 (-0700) Subject: Add type assertion to hint at output. X-Git-Tag: v0.10.5~41^2~48 X-Git-Url: https://git.codecow.com/?a=commitdiff_plain;h=523330ef5420ada4e97880791e1961f72d879b54;p=libnemo.git Add type assertion to hint at output. --- diff --git a/src/lib/crypto/nano-nacl.ts b/src/lib/crypto/nano-nacl.ts index 7417d05..0bc7d7b 100644 --- a/src/lib/crypto/nano-nacl.ts +++ b/src/lib/crypto/nano-nacl.ts @@ -115,10 +115,10 @@ export class NanoNaCl { } } - static par25519 (a: Float64Array): number { + static par25519 (a: Float64Array): 0 | 1 { const d: Uint8Array = new Uint8Array(32) this.pack25519(d, a) - return d[0] & 1 + return (d[0] & 1) as 0 | 1 } static sel25519 (p: Float64Array, q: Float64Array, b: number): void {