-
-
Notifications
You must be signed in to change notification settings - Fork 969
Closed
Labels
Description
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:
Lines 1356 to 1365 in d95ceea
set json(value: Record<string, any> | undefined) { | |
assert.any([is.object, is.undefined], value); | |
if (value !== undefined) { | |
assert.undefined(this._internals.body); | |
assert.undefined(this._internals.form); | |
} | |
this._internals.json = value; | |
} |
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?