Repository navigation
fix(isISO4217): sync the currency list with the ISO 4217 register - #2936
Open
yu2971512385-ui wants to merge 1 commit into
Open
yu2971512385-ui wants to merge 1 commit into
yu2971512385-ui wants to merge 1 commit into
Conversation
The list was taken from Wikipedia and has not kept up. Checked against ISO 4217 list one as published on 2026-09-17, it accepts four codes the register has withdrawn and rejects three it assigns: removed ANG replaced by XCG on 2025-03-31 removed BGN Bulgaria adopted the euro on 2026-01-01 removed SLL replaced by SLE on 2022-04-01 removed ZWL replaced by ZWG on 2024-04-05 added XAD Arab Accounting Dinar added XCG Caribbean Guilder added ZWG Zimbabwe Gold The README documents isISO4217 as checking for an officially assigned code, and the suite already asserts that the withdrawn HRK and CUC are invalid, so the four removals follow the behaviour the validator already claims. The source comment now points at the register itself rather than at Wikipedia, with the date of the list it was checked against. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
4 tasks done
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #2936 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 114 114
Lines 2599 2599
Branches 658 658
=========================================
Hits 2599 2599 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
isISO4217is documented in the README as checking for an officially assigned currency code, but its list was copied from Wikipedia and has gone stale. Checked against ISO 4217 list one as published on 2026-09-17, it accepts four codes the register has withdrawn and rejects three it assigns.ANGXCGon 2025-03-31BGNSLLSLEon 2022-04-01ZWLZWGon 2024-04-05XADXCGZWGAfter the change the set matches the register exactly: 178 codes, nothing extra and nothing missing.
On the four removals
They are a behaviour change — strings that used to validate no longer will — so they are worth a deliberate look. Two things suggest they are what the validator already intends:
HRKandCUC, withdrawn in 2023 and 2021, are invalid.ZWLandSLLare the same case, just more recent.If you would rather keep withdrawn codes accepted for backwards compatibility, say so and I will cut this down to the three additions.
Relation to #2842
#2842 by @simonkundrik adds
XCGandZWGand has been open since August. This change includes both of those, plusXADand the four removals. Whichever you prefer, that PR found the problem first.Tests
XAD,XCGandZWGadded tovalid;ANG,BGN,SLLandZWLadded toinvalid, alongside theHRKandCUCalready there. The test fails onmasterand passes with the fix. Full suite: 323 passing,npm run lintclean. The source comment now cites the register and the date of the list it was checked against, instead of Wikipedia.🤖 Generated with Claude Code