diff --git a/src/index.ts b/src/index.ts index daf2604..35f6539 100644 --- a/src/index.ts +++ b/src/index.ts @@ -3,13 +3,21 @@ import { Fetch, FunctionInvokeOptions } from './types' export class FunctionsClient { protected url: string - protected headers: { [key: string]: string } + protected headers: Record protected fetch: Fetch - constructor(url: string, headers?: { [key: string]: string }, customFetch?: Fetch) { + constructor( + url: string, + { + headers = {}, + customFetch, + }: { + headers?: Record + customFetch?: Fetch + } + ) { this.url = url - this.headers = headers ?? {} - + this.headers = headers this.fetch = resolveFetch(customFetch) }