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 get function typing + default #259

Merged
merged 4 commits into from
Jun 26, 2023
Merged

fix get function typing + default #259

merged 4 commits into from
Jun 26, 2023

Conversation

sodiray
Copy link
Owner

@sodiray sodiray commented Feb 23, 2023

Description

The typing of the get function was all wrong. The hard part is that there really is no way to know what the type of the resulting value will be (without using 400+ lines of recursive generic infering types). Changed the function to use unknown as the result.

Also, while here, fix the default value getting set to null. The function now respects undefined as a provided default value.

Checklist

  • Changes are covered by tests if behavior has been changed or added
  • Tests have 100% coverage
  • If code changes were made, the version in package.json has been bumped (matching semver)
  • If code changes were made, the yarn build command has been run and to update the cdn directory
  • If code changes were made, the documentation (in the /docs directory) has been updated

Resolves

Resolves #239

@vercel
Copy link

vercel bot commented Feb 23, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
radash-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 26, 2023 1:56pm

@sodiray sodiray merged commit 8680874 into master Jun 26, 2023
7 of 8 checks passed
@sodiray sodiray deleted the fix/get-typing branch June 27, 2023 13:37
aleclarson referenced this pull request in radashi-org/radashi Jun 24, 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.

Typing of get broken
1 participant