spotify / confidence-sdk-js

Other
9 stars 1 forks source link

fix: widen flag return types #142

Closed andreas-karlsson closed 4 months ago

andreas-karlsson commented 4 months ago

Hi There, I just made a Pull Request!

Right now we have an issue that flag value types are too aggressively "narrowed" by TS. For instance:

const value = await confidence.getFlag('ff', 3);

Right now TS will infer the type of value to be 3 withe the desired type being number. This PR fixes that. Ideally we should have type tests for this sort of thing. But that is saved for another day.

:heavy_check_mark: Checklist