Skip to content

fix(isBIC): add XK to accepted BIC country codes - #2046

Merged
profnandaa merged 7 commits into
validatorjs:masterfrom
ejcheng:xk-country-code
Feb 2, 2023
Merged

fix(isBIC): add XK to accepted BIC country codes#2046
profnandaa merged 7 commits into
validatorjs:masterfrom
ejcheng:xk-country-code

Conversation

@ejcheng

@ejcheng ejcheng commented Sep 20, 2022

Copy link
Copy Markdown
Contributor

Adds the country code XK (Republic of Kosovo) to isBIC's allowed country codes

closes #2045

Checklist

  • PR contains only changes related; no stray files, etc.
  • README updated (where applicable)
  • Tests written (where applicable)

@codecov

codecov Bot commented Sep 20, 2022

Copy link
Copy Markdown

Codecov Report

Base: 100.00% // Head: 100.00% // No change to project coverage 👍

Coverage data is based on head (6df1853) compared to base (6dba289).
Patch coverage: 100.00% of modified lines in pull request are covered.

Additional details and impacted files
@@            Coverage Diff            @@
##            master     #2046   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files          105       105           
  Lines         2334      2335    +1     
  Branches       586       586           
=========================================
+ Hits          2334      2335    +1     
Impacted Files Coverage Δ
src/lib/isBIC.js 100.00% <100.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@ST-DDT ST-DDT left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe extract the country code to its own variable instead of resolving it twice?

Comment thread src/lib/isBIC.js
ST-DDT
ST-DDT previously approved these changes Sep 21, 2022
@JohnIrle

JohnIrle commented Oct 1, 2022

Copy link
Copy Markdown

Would it be better to add the country code to the Set of country codes in isISO21661Alpha2.js?

@WikiRik

WikiRik commented Oct 1, 2022

Copy link
Copy Markdown
Member

No, it's not part of that list. It's a special code used only for BIC (in the scope of this project)

@WikiRik WikiRik left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you add some tests for the XK BIC? Preferably some valid and invalid.

You can add them to the current test;

it('should validate BIC codes', () => {
test({
validator: 'isBIC',
valid: [
'SBICKEN1345',
'SBICKEN1',
'SBICKENY',
'SBICKEN1YYP',
],
invalid: [
'SBIC23NXXX',
'S23CKENXXXX',
'SBICKENXX',
'SBICKENXX9',
'SBICKEN13458',
'SBICKEN',
],
});
});

@WikiRik WikiRik left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@profnandaa profnandaa left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks for your contrib 🎉

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

Labels

🎉 first-pr ✅ LGTM ready-to-land For PRs that are reviewed and ready to be landed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

isBIC country code does not accept XK

5 participants