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

fix: widen flag return types #142

Merged
merged 2 commits into from
May 27, 2024
Merged

fix: widen flag return types #142

merged 2 commits into from
May 27, 2024

Conversation

andreas-karlsson
Copy link
Contributor

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.

✔️ Checklist

  • All tests are passing
  • Relevant documentation updated
  • linter/style run on changed files
  • Tests added for new functionality
  • Regression tests added for bug fixes
  • Tested in a corresponding example app

nicklasl
nicklasl previously approved these changes May 22, 2024
@andreas-karlsson andreas-karlsson merged commit 6554e8c into main May 27, 2024
2 checks passed
@andreas-karlsson andreas-karlsson deleted the widen-flag-types branch May 27, 2024 07:34
@github-actions github-actions bot mentioned this pull request May 27, 2024
@github-actions github-actions bot mentioned this pull request Jun 3, 2024
@github-actions github-actions bot mentioned this pull request Aug 13, 2024
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

Successfully merging this pull request may close these issues.

2 participants