-
-
Notifications
You must be signed in to change notification settings - Fork 504
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
Jsonify makes Record<string, any> disappear #667
Comments
Behavior confirmed via #668 PR workflow run: https://github.com/sindresorhus/type-fest/actions/runs/5959009025/job/16164096431?pr=668#step:5:11
|
I agree. |
Same issue happens when having CC/ @sachinraja as he created the original |
I’ll take a look when I can but that type actually comes from Remix's initial jsonify implementation |
@sachinraja Is there anything I can help you with to get this one fixed? |
Ok tracked this down to this line: T extends TypedArray ? Record<string, number> :
// ... That Here's a minimal repro with suggested fix: https://tsplay.dev/N7VJqw |
Here's a TS Playground:
This feels like a bug to me. It's causing an issue for me in the upcoming version of Remix: remix-run/remix#7246
My current workaround is to change the type to
unknown
instead ofany
(edmundhung/conform#272 which will hopefully be merged soon). I think is the proper thing to do, but sometimes that's hard because you may not control the type. I think it's more correct to keep the record around on the type.Upvote & Fund
The text was updated successfully, but these errors were encountered: