feat: add static Response.json#1670
Conversation
| return response; | ||
| } | ||
|
|
||
| static json(data = undefined, init = {}) { |
There was a problem hiding this comment.
node-fetch doesn't seem to do much argument validation, I followed other areas of the code.
For example when constructing a new response:
new Response('', null)throws an error when it shouldn't
new Response('', 3)works when it shouldn't (same with booleans, etc)
|
I'm okey with some small deviations, we don't have all the webidl stuff undici have and don't follow the spec at 100%. it was set up to be "good enough" and solve the most common use cases. it's going to be replaced by NodeJS in the newer versions anyway at some point. node-fetch is just a polyfill at this stage. |
|
🎉 This PR is included in version 3.3.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |

Purpose
Implements static
Response.jsonfrom whatwg/fetch#1392Changes
Adds static Response.json
Additional information