Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can we export IBAN countries to check if the country implements IBAN? #1570

Closed
Poky85 opened this issue Jan 4, 2021 · 6 comments
Closed

Comments

@Poky85
Copy link

Poky85 commented Jan 4, 2021

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

@profnandaa
Copy link
Member

PR welcome.

@drorheller
Copy link
Contributor

drorheller commented May 5, 2021

I'd be happy to open this pr

@drorheller
Copy link
Contributor

Hey @profnandaa :)
I need a maintainer to approve my pr please

@sharechiwai
Copy link

@drorheller, @profnandaa look like PR has been merged, do you think this task can be closed?

@tux-tn
Copy link
Member

tux-tn commented Sep 30, 2021

Closed in #1669
Thank you @sharechiwai for the reminder

@tux-tn tux-tn closed this as completed Sep 30, 2021
@drorheller
Copy link
Contributor

@drorheller, @profnandaa look like PR has been merged, do you think this task can be closed?

I don't see why not

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants