Socket
Socket
Sign inDemoInstall

gaxios

Package Overview
Dependencies
Maintainers
1
Versions
78
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

gaxios - npm Package Compare versions

Comparing version 5.1.0 to 5.1.1

15

build/src/common.js

@@ -22,2 +22,3 @@ "use strict";

this.config = options;
this.response.data = translateData(options.responseType, response.data);
this.code = response.status.toString();

@@ -27,2 +28,16 @@ }

exports.GaxiosError = GaxiosError;
function translateData(responseType, data) {
switch (responseType) {
case 'stream':
return data;
case 'json':
return JSON.parse(JSON.stringify(data));
case 'arraybuffer':
return JSON.parse(Buffer.from(data).toString('utf8'));
case 'blob':
return JSON.parse(data.text());
default:
return JSON.parse(data.text());
}
}
//# sourceMappingURL=common.js.map

@@ -130,2 +130,12 @@ "use strict";

if (!opts.validateStatus(translatedResponse.status)) {
if (opts.responseType === 'stream') {
let response = '';
await new Promise(resolve => {
translatedResponse.data.on('data', chunk => {
response += chunk;
});
translatedResponse.data.on('end', resolve);
});
translatedResponse.data = response;
}
throw new common_1.GaxiosError(`Request failed with status code ${translatedResponse.status}`, opts, translatedResponse);

@@ -132,0 +142,0 @@ }

# Changelog
## [5.1.1](https://github.com/googleapis/gaxios/compare/v5.1.0...v5.1.1) (2023-06-23)
### Bug Fixes
* Translate GaxiosError message to object regardless of return type ([#537](https://github.com/googleapis/gaxios/issues/537)) ([563c653](https://github.com/googleapis/gaxios/commit/563c6537a06bc64d5c6e918090c00ec7a586cecb))
## [5.1.0](https://github.com/googleapis/gaxios/compare/v5.0.2...v5.1.0) (2023-03-06)

@@ -4,0 +11,0 @@

9

package.json
{
"name": "gaxios",
"version": "5.1.0",
"version": "5.1.1",
"description": "A simple common HTTP client specifically for Google APIs and services.",

@@ -40,2 +40,3 @@ "main": "build/src/index.js",

"devDependencies": {
"@babel/plugin-proposal-private-methods": "^7.18.6",
"@compodoc/compodoc": "^1.1.9",

@@ -57,3 +58,3 @@ "@types/cors": "^2.8.6",

"browserify": "^17.0.0",
"c8": "^7.0.0",
"c8": "^8.0.0",
"cors": "^2.8.5",

@@ -80,3 +81,3 @@ "execa": "^5.0.0",

"null-loader": "^4.0.0",
"puppeteer": "^18.0.0",
"puppeteer": "^20.0.0",
"sinon": "^15.0.0",

@@ -95,4 +96,4 @@ "stream-browserify": "^3.0.0",

"is-stream": "^2.0.0",
"node-fetch": "^2.6.7"
"node-fetch": "^2.6.9"
}
}

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc