From 5d534ec10ffbd28206efc62b9ea54d7122b8cb4f Mon Sep 17 00:00:00 2001 From: Chris Duncan Date: Sun, 9 Aug 2026 23:27:55 -0700 Subject: [PATCH] Type check from before addition. --- src/lib/wallet/accounts.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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}` }) } -- 2.52.0