@supabase/functions-js
Advanced tools
Comparing version 1.4.0-next.2 to 1.4.0-next.3
@@ -41,24 +41,26 @@ "use strict"; | ||
let body; | ||
if ((typeof Blob !== 'undefined' && functionArgs instanceof Blob) || | ||
functionArgs instanceof ArrayBuffer) { | ||
// will work for File as File inherits Blob | ||
// also works for ArrayBuffer as it is the same underlying structure as a Blob | ||
_headers['Content-Type'] = 'application/octet-stream'; | ||
body = functionArgs; | ||
if (functionArgs && !Object.prototype.hasOwnProperty.call(headers, 'Content-Type')) { | ||
if ((typeof Blob !== 'undefined' && functionArgs instanceof Blob) || | ||
functionArgs instanceof ArrayBuffer) { | ||
// will work for File as File inherits Blob | ||
// also works for ArrayBuffer as it is the same underlying structure as a Blob | ||
_headers['Content-Type'] = 'application/octet-stream'; | ||
body = functionArgs; | ||
} | ||
else if (typeof functionArgs === 'string') { | ||
// plain string | ||
_headers['Content-Type'] = 'text/plain'; | ||
body = functionArgs; | ||
} | ||
else if (typeof FormData !== 'undefined' && functionArgs instanceof FormData) { | ||
// don't set content-type headers | ||
// Request will automatically add the right boundary value | ||
body = functionArgs; | ||
} | ||
else { | ||
// default, assume this is JSON | ||
_headers['Content-Type'] = 'application/json'; | ||
body = JSON.stringify(functionArgs); | ||
} | ||
} | ||
else if (typeof functionArgs === 'string') { | ||
// plain string | ||
_headers['Content-Type'] = 'text/plain'; | ||
body = functionArgs; | ||
} | ||
else if (typeof FormData !== 'undefined' && functionArgs instanceof FormData) { | ||
// don't set content-type headers | ||
// Request will automatically add the right boundary value | ||
body = functionArgs; | ||
} | ||
else { | ||
// default, assume this is JSON | ||
_headers['Content-Type'] = 'application/json'; | ||
body = JSON.stringify(functionArgs); | ||
} | ||
const response = yield this.fetch(`${this.url}/${functionName}`, { | ||
@@ -65,0 +67,0 @@ method: 'POST', |
@@ -1,2 +0,2 @@ | ||
export declare const version = "1.4.0-next.2"; | ||
export declare const version = "1.4.0-next.3"; | ||
//# sourceMappingURL=version.d.ts.map |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.version = void 0; | ||
exports.version = '1.4.0-next.2'; | ||
exports.version = '1.4.0-next.3'; | ||
//# sourceMappingURL=version.js.map |
@@ -38,24 +38,26 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
let body; | ||
if ((typeof Blob !== 'undefined' && functionArgs instanceof Blob) || | ||
functionArgs instanceof ArrayBuffer) { | ||
// will work for File as File inherits Blob | ||
// also works for ArrayBuffer as it is the same underlying structure as a Blob | ||
_headers['Content-Type'] = 'application/octet-stream'; | ||
body = functionArgs; | ||
if (functionArgs && !Object.prototype.hasOwnProperty.call(headers, 'Content-Type')) { | ||
if ((typeof Blob !== 'undefined' && functionArgs instanceof Blob) || | ||
functionArgs instanceof ArrayBuffer) { | ||
// will work for File as File inherits Blob | ||
// also works for ArrayBuffer as it is the same underlying structure as a Blob | ||
_headers['Content-Type'] = 'application/octet-stream'; | ||
body = functionArgs; | ||
} | ||
else if (typeof functionArgs === 'string') { | ||
// plain string | ||
_headers['Content-Type'] = 'text/plain'; | ||
body = functionArgs; | ||
} | ||
else if (typeof FormData !== 'undefined' && functionArgs instanceof FormData) { | ||
// don't set content-type headers | ||
// Request will automatically add the right boundary value | ||
body = functionArgs; | ||
} | ||
else { | ||
// default, assume this is JSON | ||
_headers['Content-Type'] = 'application/json'; | ||
body = JSON.stringify(functionArgs); | ||
} | ||
} | ||
else if (typeof functionArgs === 'string') { | ||
// plain string | ||
_headers['Content-Type'] = 'text/plain'; | ||
body = functionArgs; | ||
} | ||
else if (typeof FormData !== 'undefined' && functionArgs instanceof FormData) { | ||
// don't set content-type headers | ||
// Request will automatically add the right boundary value | ||
body = functionArgs; | ||
} | ||
else { | ||
// default, assume this is JSON | ||
_headers['Content-Type'] = 'application/json'; | ||
body = JSON.stringify(functionArgs); | ||
} | ||
const response = yield this.fetch(`${this.url}/${functionName}`, { | ||
@@ -62,0 +64,0 @@ method: 'POST', |
@@ -1,2 +0,2 @@ | ||
export declare const version = "1.4.0-next.2"; | ||
export declare const version = "1.4.0-next.3"; | ||
//# sourceMappingURL=version.d.ts.map |
@@ -1,2 +0,2 @@ | ||
export const version = '1.4.0-next.2'; | ||
export const version = '1.4.0-next.3'; | ||
//# sourceMappingURL=version.js.map |
{ | ||
"name": "@supabase/functions-js", | ||
"version": "1.4.0-next.2", | ||
"version": "1.4.0-next.3", | ||
"description": "JS Client library to interact with Supabase Functions.", | ||
@@ -5,0 +5,0 @@ "main": "dist/main/index.js", |
@@ -57,22 +57,24 @@ import { resolveFetch } from './helper' | ||
let body: any | ||
if ( | ||
(typeof Blob !== 'undefined' && functionArgs instanceof Blob) || | ||
functionArgs instanceof ArrayBuffer | ||
) { | ||
// will work for File as File inherits Blob | ||
// also works for ArrayBuffer as it is the same underlying structure as a Blob | ||
_headers['Content-Type'] = 'application/octet-stream' | ||
body = functionArgs | ||
} else if (typeof functionArgs === 'string') { | ||
// plain string | ||
_headers['Content-Type'] = 'text/plain' | ||
body = functionArgs | ||
} else if (typeof FormData !== 'undefined' && functionArgs instanceof FormData) { | ||
// don't set content-type headers | ||
// Request will automatically add the right boundary value | ||
body = functionArgs | ||
} else { | ||
// default, assume this is JSON | ||
_headers['Content-Type'] = 'application/json' | ||
body = JSON.stringify(functionArgs) | ||
if (functionArgs && !Object.prototype.hasOwnProperty.call(headers, 'Content-Type')) { | ||
if ( | ||
(typeof Blob !== 'undefined' && functionArgs instanceof Blob) || | ||
functionArgs instanceof ArrayBuffer | ||
) { | ||
// will work for File as File inherits Blob | ||
// also works for ArrayBuffer as it is the same underlying structure as a Blob | ||
_headers['Content-Type'] = 'application/octet-stream' | ||
body = functionArgs | ||
} else if (typeof functionArgs === 'string') { | ||
// plain string | ||
_headers['Content-Type'] = 'text/plain' | ||
body = functionArgs | ||
} else if (typeof FormData !== 'undefined' && functionArgs instanceof FormData) { | ||
// don't set content-type headers | ||
// Request will automatically add the right boundary value | ||
body = functionArgs | ||
} else { | ||
// default, assume this is JSON | ||
_headers['Content-Type'] = 'application/json' | ||
body = JSON.stringify(functionArgs) | ||
} | ||
} | ||
@@ -79,0 +81,0 @@ |
@@ -1,1 +0,1 @@ | ||
export const version = '1.4.0-next.2' | ||
export const version = '1.4.0-next.3' |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
41347
632