country-codes-list
country-codes-list copied to clipboard
fix: replace CountryProperty enum by union
The current version of the library does not work with TypeScript. The issue is demonstrated in this sandox. The problem is that index.d.ts
exposes an enum type which is used as param in functions like findOne
. However, this enum is not backed by any object in JS, so the code compiles but breaks at runtime.
One simple way to fix this, it's by exporting a constant object for the enum (done in #40). However, removing this enum and replacing it with a union type is a more elegant solution which does not need to change the JS implementation.
Fixes #36
Why is this not merged yet ??