From be6962a0db98a45abb1cddbe592560d6601e6707 Mon Sep 17 00:00:00 2001 From: egor-romanov Date: Mon, 4 Apr 2022 18:05:12 +0400 Subject: [PATCH 1/2] fix: FunctionsClient constructor default options --- src/index.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/index.ts b/src/index.ts index 99cf5ea..3770f7e 100644 --- a/src/index.ts +++ b/src/index.ts @@ -9,15 +9,15 @@ export class FunctionsClient { constructor( url: string, { - headers = {}, + headers, customFetch, }: { headers?: Record customFetch?: Fetch - } + } = {} ) { this.url = url - this.headers = headers + this.headers = headers ?? {} this.fetch = resolveFetch(customFetch) } From 9b3635b7918dcd9d7aa370c992592fc27a5291e2 Mon Sep 17 00:00:00 2001 From: egor-romanov Date: Tue, 5 Apr 2022 13:13:55 +0400 Subject: [PATCH 2/2] fix: return headers default value --- src/index.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/index.ts b/src/index.ts index 3770f7e..fef1a2e 100644 --- a/src/index.ts +++ b/src/index.ts @@ -9,7 +9,7 @@ export class FunctionsClient { constructor( url: string, { - headers, + headers = {}, customFetch, }: { headers?: Record @@ -17,7 +17,7 @@ export class FunctionsClient { } = {} ) { this.url = url - this.headers = headers ?? {} + this.headers = headers this.fetch = resolveFetch(customFetch) }