Skip to content
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

The codes from currency-codes are out-of-date #217

Open
JstnMcBrd opened this issue Jul 19, 2024 · 3 comments
Open

The codes from currency-codes are out-of-date #217

JstnMcBrd opened this issue Jul 19, 2024 · 3 comments

Comments

@JstnMcBrd
Copy link
Contributor

The currency-codes package is 4 years out-of-date and looks like it is dead. The ISO 4217 standard has had many updates since that time, but the package does not reflect them.

That could result in this package throwing errors when trying to find the decimal value of legitimate currencies that currency-codes does not know about.

@frodeaa
Copy link
Contributor

frodeaa commented Jul 27, 2024

We can probably replace the dependency with Intl.NumberFormat.resolvedOptions, the cons is that its currency support is limited by the host

See: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/resolvedOptions

@JstnMcBrd
Copy link
Contributor Author

I did a quick search and found some options you could consider:

  • currency-codes-ts - Forked from the package you use, designed for TypeScript, but hasn't been updated in 10 months
  • @holm/currency-codes-ts - Forked from the above, slightly different, but also hasn't been updated in 8 months
  • @iso4217/json - Contains all the currency info as a JSON, so not as easy to access in JS, updated automatically so always guaranteed to be up-to-date

@frodeaa
Copy link
Contributor

frodeaa commented Aug 2, 2024

I think maybe a change where you can bring your own mapping could be useful.

It is not a problem to use a currency-codes module that does not update regulary as there are probably few changes to the currencies and for most use case it is only a limited currencies that a user will care about

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants