Socket
Socket
Sign inDemoInstall

node-fetch

Package Overview
Dependencies
6
Maintainers
5
Versions
96
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 2.6.9 to 2.6.10

6

lib/index.es.js

@@ -265,5 +265,5 @@ process.emitWarning("The .es.js file is deprecated. Use .mjs instead.");

return consumeBody.call(this).then(function (buffer) {
return this.text().then(function (text) {
try {
return JSON.parse(buffer.toString());
return JSON.parse(text);
} catch (err) {

@@ -282,3 +282,3 @@ return Body.Promise.reject(new FetchError(`invalid json response body at ${_this2.url} reason: ${err.message}`, 'invalid-json'));

return consumeBody.call(this).then(function (buffer) {
return buffer.toString();
return new TextDecoder().decode(buffer);
});

@@ -285,0 +285,0 @@ },

@@ -269,5 +269,5 @@ 'use strict';

return consumeBody.call(this).then(function (buffer) {
return this.text().then(function (text) {
try {
return JSON.parse(buffer.toString());
return JSON.parse(text);
} catch (err) {

@@ -286,3 +286,3 @@ return Body.Promise.reject(new FetchError(`invalid json response body at ${_this2.url} reason: ${err.message}`, 'invalid-json'));

return consumeBody.call(this).then(function (buffer) {
return buffer.toString();
return new TextDecoder().decode(buffer);
});

@@ -289,0 +289,0 @@ },

{
"name": "node-fetch",
"version": "2.6.9",
"version": "2.6.10",
"description": "A light-weight module that brings window.fetch to node.js",

@@ -5,0 +5,0 @@ "main": "lib/index.js",

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc