diff --git a/src/ApiClient.js b/src/ApiClient.js index 337b075..7b41f93 100644 --- a/src/ApiClient.js +++ b/src/ApiClient.js @@ -157,7 +157,7 @@ */ exports.prototype.isFileParam = function(param) { // fs.ReadStream in Node.js (but not in runtime like browserify) - if (typeof window === 'undefined' && + if (Object.prototype.toString.call(global.process) === '[object process]' && typeof require === 'function' && require('fs') && param instanceof require('fs').ReadStream) { diff --git a/src/api/DefaultApi.js b/src/api/DefaultApi.js index a51a9a0..457949a 100644 --- a/src/api/DefaultApi.js +++ b/src/api/DefaultApi.js @@ -324,7 +324,7 @@ var authNames = ['Token']; var contentTypes = []; var accepts = ['image/png', 'image/jpeg', 'applicant/pdf']; - var returnType = File; + var returnType = (typeof File !== 'undefined') ? File : []; return this.apiClient.callApi( '/applicants/{applicant_id}/documents/{document_id}/download', 'GET', @@ -370,7 +370,7 @@ var authNames = ['Token']; var contentTypes = []; var accepts = ['application/json']; - var returnType = File; + var returnType = (typeof File !== 'undefined') ? File : []; return this.apiClient.callApi( '/live_photos/{live_photo_id}/download', 'GET',