-
Notifications
You must be signed in to change notification settings - Fork 787
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
feature: allow to blacklist or whitelist country codes in the IsIBAN decorator #2048
Comments
@CodingSpiderFox looks like in order to achieve that it would be necessary to make some changes on library that checks the IBAN. |
I would just follow a naive approach (pseudocode) let matchesValid = false; return matchesValid && |
Maybe for now we could use your approach whilst the lib that checks the IBAN doesn't implement this feature. |
I suggest you resubmit this in validator.js. This library is not in the habit of augmenting validators from validator.js with custom logic unless there is a particularly strong reason for it. In the meantime you can use a custom validator for this. |
Hey @braaar actually there's a PR opened in validator.js for that purpose, once it gets merged maybe we could implement it here. |
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Description
I want to build an API that only accepts german IBANs for payments.
Proposed solution
Add options to the decorators that allow to either
Each of the two params should allow an array of ISO3166-2 country codes as strings (or maybe use an enum for TS?).
Should look something like this for the API
The text was updated successfully, but these errors were encountered: