]> git.codecow.com Git - libnemo.git/commitdiff
Type check from before addition.
authorChris Duncan <chris@codecow.com>
Mon, 10 Aug 2026 06:27:55 +0000 (23:27 -0700)
committerChris Duncan <chris@codecow.com>
Mon, 10 Aug 2026 06:27:55 +0000 (23:27 -0700)
src/lib/wallet/accounts.ts

index 69614e591b0e97beca59a05dd9fd3e9bf6eced07..412e9b3c96fe490c30acd0865306a87f9c2ecb11 100644 (file)
@@ -11,10 +11,10 @@ export async function _accounts (type: WalletType, accounts: Map<number, Account
 export async function _accounts (type: WalletType, accounts: Map<number, Account>, vault: Vault, from: number, to: number): Promise<Map<number, Account>>
 export async function _accounts (type: WalletType, accounts: Map<number, Account>, vault: Vault, from: unknown, to?: unknown): Promise<Account | Map<number, Account>> {
        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}` })
        }