| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Codecov ReportPatch coverage: 100.00% and no project coverage change.
Additional details and impacted files @@ Coverage Diff @@
## master #2235 +/- ##
=======================================
Coverage 99.95% 99.95%
=======================================
Files 107 107
Lines 2414 2431 +17
Branches 607 614 +7
=======================================
+ Hits 2413 2430 +17
Partials 1 1
☔ View full report in Codecov by Sentry. |
Sorry, something went wrong.
| **isHexColor(str)** | check if the string is a hexadecimal color. | ||
| **isHSL(str)** | check if the string is an HSL (hue, saturation, lightness, optional alpha) color based on [CSS Colors Level 4 specification][CSS Colors Level 4 Specification].<br/><br/>Comma-separated format supported. Space-separated format supported with the exception of a few edge cases (ex: `hsl(200grad+.1%62%/1)`). | ||
| **isIBAN(str)** | check if the string is an IBAN (International Bank Account Number). | ||
| **isIBAN(str)** | check if the string is an IBAN (International Bank Account Number).<br/><br/>Also allows you to define a whitelist, when you only want to recieve IBAN codes from certain countries or a blacklist, removing some of them from the current list. |
There was a problem hiding this comment.
Could you elaborate on how you can define this? Like we explain the options object in other validators as well. Also with the list of supported country codes
Sorry, something went wrong.
There was a problem hiding this comment.
@WikiRik I have updated and put which attributes it will receive and also the values that can be used in each of them.
Sorry, something went wrong.
There was a problem hiding this comment.
Can you undo the style changes in README?
Sorry, something went wrong.
…or without formatting it
|
@WikiRik do you think this could be merged now? |
Sorry, something went wrong.
|
@pano9000 @profnandaa could you take a look on this feature, please? |
Sorry, something went wrong.
| const isoCountryCodeInWhiteList = options.whitelist.includes(isoCountryCode); | ||
|
|
||
| if (!isoCountryCodeInWhiteList) { | ||
| throw new Error('IBAN code does not belong to one of the countries listed on whitelist!'); |
There was a problem hiding this comment.
nit: the pattern so far has not been to throw errors, just true/false. I'm not sure how to go about this one...
Sorry, something went wrong.
There was a problem hiding this comment.
I guess we can continue with the true/false approach and let the user decide how to treat this.
Sorry, something went wrong.
There was a problem hiding this comment.
Done @profnandaa
Sorry, something went wrong.
There was a problem hiding this comment.
LGTM.
Sorry, something went wrong.
|
Thanks, folks |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
feat(isIBAN): add white and blacklist options to the isIBAN validator
In order to restrict the list of countries that I want to validate the IBAN against now we can pass the whitelist option with the country codes that I want to validate the code. Also if I want to remove a certain country from the validation now I will have the blacklist option and the countries passed there will be removed from validation.
So, if you use the isIBAN validator and pass a the whitelist option and the country from the IBAN code is not on the whitelist, it will return an error:
And if you use the same validator with the blacklist option it should return an error if the code passed is from one of the countries listed:
Checklist