-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Closed
Description
Issue
isIBAN() validator allows user to validate IBAN and it contains IBAN definitions as used in many countries world-wide. In my current project I validate account numbers and not all of them implement IBAN. So I need to check if the country implements IBAN or not.
In isIBAN() there are IBAN definitions per countries so maybe it could export the regular so user can check the country?
Examples
Many countries (for example Australia, Canada or US) doesn't implement IBAN.
Validator could export something like
const ibanRegexThroughCountryCode = {
AD: /^(AD[0-9]{2})\d{8}[A-Z0-9]{12}$/,
AE: /^(AE[0-9]{2})\d{3}\d{16}$/,
…
}
export const ibanCountryCodes = Object.keys(ibanRegexThroughCountryCode)So user can apply IBAN validator only when appropriate.
Additional context
Validator.js version: 13.5.2