Skip to content

Commit

Permalink
fix(stark-core): fix starkIsIBAN validation method after upgrade "iba…
Browse files Browse the repository at this point in the history
…ntools" dependency
  • Loading branch information
SuperITMan committed Mar 2, 2021
1 parent a0d5fa9 commit 0fc2be3
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,10 @@ export const starkIsIBANValidatorName = "starkIsIBAN";
* @param iban - The IBAN number to validate
*/
export function starkIsIBAN(iban: string): boolean {
if (typeof iban === "string") {
const electronicIban = electronicFormatIBAN(iban);
if (typeof electronicIban === "string") {
// Since v2.0.0 of ibantools, isValidIBAN() is false if there is " " in the verified IBAN
return isValidIBAN(electronicFormatIBAN(iban));
return isValidIBAN(electronicIban);
}
return false;
}

0 comments on commit 0fc2be3

Please sign in to comment.