From 315baadef57797ce6156a69997d11dfa4b96b989 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Cabrita?= Date: Fri, 15 May 2026 16:50:46 +0100 Subject: [PATCH] fix: valid always throws an error if called with two arguments --- src/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/index.ts b/src/index.ts index a168921..f56cc4b 100644 --- a/src/index.ts +++ b/src/index.ts @@ -108,7 +108,7 @@ export default class Kontonummer { // eslint-disable-next-line @typescript-eslint/unified-signatures public static valid (sortingCode: string | number, accountNumber: string | number): boolean public static valid (sortingCodeWithOrWithoutAccountNumber: string | number, accountNumber?: string | number) { - if (accountNumber && (typeof accountNumber !== 'string' || typeof accountNumber !== 'number')) throw new KontonummerError('Kontonummer.valid() does not accept an options argument') + if (accountNumber && !(typeof accountNumber === 'string' || typeof accountNumber === 'number')) throw new KontonummerError('Kontonummer.valid() does not accept an options argument') try { if (accountNumber) new Kontonummer(sortingCodeWithOrWithoutAccountNumber, accountNumber) // eslint-disable-line no-new else new Kontonummer(sortingCodeWithOrWithoutAccountNumber) // eslint-disable-line no-new