Comparing version 1.2.4 to 1.2.5
@@ -34,3 +34,4 @@ import { GaxiosOptions, GaxiosPromise } from './common'; | ||
private paramsSerializer; | ||
private isReadableStream; | ||
private translateResponse; | ||
} |
@@ -26,2 +26,3 @@ "use strict"; | ||
const qs = require("querystring"); | ||
const stream = require("stream"); | ||
const url_1 = require("url"); | ||
@@ -106,3 +107,6 @@ const common_1 = require("./common"); | ||
if (opts.data) { | ||
if (typeof opts.data === 'object') { | ||
if (this.isReadableStream(opts.data)) { | ||
opts.body = opts.data; | ||
} | ||
else if (typeof opts.data === 'object') { | ||
opts.body = JSON.stringify(opts.data); | ||
@@ -154,2 +158,5 @@ opts.headers['Content-Type'] = 'application/json'; | ||
} | ||
isReadableStream(obj) { | ||
return obj instanceof stream.Readable && typeof obj._read === 'function'; | ||
} | ||
translateResponse(opts, res, data) { | ||
@@ -156,0 +163,0 @@ // headers need to be converted from a map to an obj |
{ | ||
"name": "gaxios", | ||
"version": "1.2.4", | ||
"version": "1.2.5", | ||
"description": "A simple common HTTP client specifically for Google APIs and services.", | ||
@@ -5,0 +5,0 @@ "main": "build/src/index.js", |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
45114
499