@supabase/functions-js
Advanced tools
Comparing version 1.2.1 to 1.2.2
@@ -18,3 +18,3 @@ "use strict"; | ||
this.headers = headers; | ||
this.fetch = (0, helper_1.resolveFetch)(fetch); | ||
this.fetch = (0, helper_1.resolveFetch)(customFetch); | ||
} | ||
@@ -45,2 +45,6 @@ /** | ||
}); | ||
const isRelayError = response.headers.get('x-relay-error'); | ||
if (isRelayError && isRelayError === 'true') { | ||
return { data: null, error: new Error(yield response.text()) }; | ||
} | ||
let data; | ||
@@ -60,6 +64,2 @@ const { responseType } = invokeOptions !== null && invokeOptions !== void 0 ? invokeOptions : {}; | ||
} | ||
const isRelayError = response.headers.get('x-relay-error'); | ||
if (isRelayError && isRelayError === 'true') { | ||
return { data: null, error: data }; | ||
} | ||
return { data, error: null }; | ||
@@ -66,0 +66,0 @@ } |
@@ -15,3 +15,3 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
this.headers = headers; | ||
this.fetch = resolveFetch(fetch); | ||
this.fetch = resolveFetch(customFetch); | ||
} | ||
@@ -42,2 +42,6 @@ /** | ||
}); | ||
const isRelayError = response.headers.get('x-relay-error'); | ||
if (isRelayError && isRelayError === 'true') { | ||
return { data: null, error: new Error(yield response.text()) }; | ||
} | ||
let data; | ||
@@ -57,6 +61,2 @@ const { responseType } = invokeOptions !== null && invokeOptions !== void 0 ? invokeOptions : {}; | ||
} | ||
const isRelayError = response.headers.get('x-relay-error'); | ||
if (isRelayError && isRelayError === 'true') { | ||
return { data: null, error: data }; | ||
} | ||
return { data, error: null }; | ||
@@ -63,0 +63,0 @@ } |
{ | ||
"name": "@supabase/functions-js", | ||
"version": "1.2.1", | ||
"version": "1.2.2", | ||
"description": "JS Client library to interact with Supabase Functions.", | ||
@@ -5,0 +5,0 @@ "main": "dist/main/index.js", |
@@ -13,3 +13,3 @@ import { resolveFetch } from './helper' | ||
this.fetch = resolveFetch(fetch) | ||
this.fetch = resolveFetch(customFetch) | ||
} | ||
@@ -45,2 +45,7 @@ | ||
const isRelayError = response.headers.get('x-relay-error') | ||
if (isRelayError && isRelayError === 'true') { | ||
return { data: null, error: new Error(await response.text()) } | ||
} | ||
let data | ||
@@ -58,7 +63,2 @@ const { responseType } = invokeOptions ?? {} | ||
const isRelayError = response.headers.get('x-relay-error') | ||
if (isRelayError && isRelayError === 'true') { | ||
return { data: null, error: data } | ||
} | ||
return { data, error: null } | ||
@@ -65,0 +65,0 @@ } catch (error: any) { |
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
35468
4