country-codes-list icon indicating copy to clipboard operation
country-codes-list copied to clipboard

fix: replace CountryProperty enum by union

Open alexdeleon opened this issue 1 year ago • 2 comments

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.

alexdeleon avatar Nov 29 '23 20:11 alexdeleon

Fixes #36

alexdeleon avatar Nov 29 '23 20:11 alexdeleon

Why is this not merged yet ??

flazouh avatar Jul 20 '24 21:07 flazouh