validator.js icon indicating copy to clipboard operation
validator.js copied to clipboard

feat(isTaxID): Accept ISO 3166-1 alpha-2 country codes

Open bartmalanczuk opened this issue 4 years ago • 9 comments

Changes accepted locale format for isTaxID validator

Resolves #1707

Checklist

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

bartmalanczuk avatar Oct 03 '21 23:10 bartmalanczuk

Codecov Report

Merging #1756 (b9fa8c7) into master (13651ea) will not change coverage. The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff            @@
##            master     #1756   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files          102       102           
  Lines         2029      2027    -2     
  Branches       457       458    +1     
=========================================
- Hits          2029      2027    -2     
Impacted Files Coverage Δ
src/lib/isTaxID.js 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 13651ea...b9fa8c7. Read the comment docs.

codecov[bot] avatar Oct 03 '21 23:10 codecov[bot]

Aliases everywhere🙃

fedeci avatar Oct 04 '21 10:10 fedeci

@tux-tn understood- I can provide a fix supporting both variants

bartmalanczuk avatar Oct 04 '21 10:10 bartmalanczuk

@tux-tn it makes sense to me, definitely smarter😃

fedeci avatar Oct 06 '21 11:10 fedeci

@tux-tn implemented your solution, tests pass and looks much better 😄

bartmalanczuk avatar Oct 07 '21 09:10 bartmalanczuk

@tux-tn I reverted reordering (but I kept renaming of the functions) and simplified the tests as requested. Can you only advise me what to do with the Readme/ documentation because I'm not sure if we are on the same page 😅

bartmalanczuk avatar Oct 12 '21 12:10 bartmalanczuk

Thank you for the efforts @bartmalanczuk 👍 I really appreciate it !

As @fedeci suggested we probably want to add a paragraph to tell that locales with ISO 639 country codes are supported but will be removed in the future.

I suggest to wait for @profnandaa review. He will probably have a suggestion concerning the wording or what to do concerning the depreciation.

tux-tn avatar Oct 13 '21 07:10 tux-tn

Thanks for the awesome work @bartmalanczuk and @tux-tn. Please merge!

clytras avatar Nov 02 '21 21:11 clytras

cc @profnandaa any feedback on this?

tux-tn avatar Nov 04 '21 09:11 tux-tn