From: Chris Duncan Date: Mon, 10 Aug 2026 06:27:55 +0000 (-0700) Subject: Type check from before addition. X-Git-Url: https://git.codecow.com/?a=commitdiff_plain;h=5d534ec10ffbd28206efc62b9ea54d7122b8cb4f;p=libnemo.git Type check from before addition. --- diff --git a/src/lib/wallet/accounts.ts b/src/lib/wallet/accounts.ts index 69614e5..412e9b3 100644 --- a/src/lib/wallet/accounts.ts +++ b/src/lib/wallet/accounts.ts @@ -11,10 +11,10 @@ export async function _accounts (type: WalletType, accounts: Map, vault: Vault, from: number, to: number): Promise> export async function _accounts (type: WalletType, accounts: Map, vault: Vault, from: unknown, to?: unknown): Promise> { const isSingle = to === undefined - to ??= from + 1 if (typeof from !== 'number') { throw new Error('Invalid account range start argument', { cause: `${typeof from} ${from}` }) - } + } + to ??= from + 1 if (typeof to !== 'number') { throw new Error('Invalid account range end argument', { cause: `${typeof to} ${to}` }) }