-
-
Notifications
You must be signed in to change notification settings - Fork 968
Closed
Labels
Description
As discussed there: sindresorhus/ky#254 (comment)
Option should allow to pass a user-function that will perform JSON parsing.
Use cases:
- Use
bourne
to mitigate the hyped prototype pollution. - Parse JSON with
reviver
Example API:
type ParseJsonFunction = <OUTPUT = unknown>(text: string) => OUTPUT
const myGot = got.extend({
parseJson: text => bourne(text),
})
Should be available both via .extend()
and as an option to each request.
szmarczak and CaimDev