node-fetch
Advanced tools
Comparing version 2.6.9 to 2.6.10
@@ -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
161590