-
-
Notifications
You must be signed in to change notification settings - Fork 934
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
does json
option support all json values?
#2013
Comments
In that case value should be typed as |
@szmarczak dya mean the type for the it can be typed better than
|
TypeScript ships |
@szmarczak i made the proposed I wanted to add some tests but wasn't sure which test file would be most appropriate. |
@szmarczak i'm closing this issue. note that sindresorhus suggested to use unknown for the return value of i can confirm that using |
I was trying to use GOT (latest) with Typescript to write some "niche" tests that send some json that probably only people trying to break your server would use.
values such as:
true
,false
,null
,"123"
,1
,[1,2,3]
.But noticed that GOT only supports
Record<string, any>
.here's the source of it:
got/source/core/options.ts
Lines 1356 to 1365 in d95ceea
This means only objects and array can be passed in.
Shouldnt
json
support all valid json values?I tried looking up documenation or issues to understand why this limitation exists but didn't find any :(
If this limitation is here to stay, then is there a way to use GOT to send the other json values?
The text was updated successfully, but these errors were encountered: