Skip to content

Commit

Permalink
fix: put all optional params in an object
Browse files Browse the repository at this point in the history
  • Loading branch information
soedirgo committed Mar 28, 2022
1 parent 0f9a079 commit ad78a6b
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,21 @@ import { Fetch, FunctionInvokeOptions } from './types'

export class FunctionsClient {
protected url: string
protected headers: { [key: string]: string }
protected headers: Record<string, string>
protected fetch: Fetch

constructor(url: string, headers?: { [key: string]: string }, customFetch?: Fetch) {
constructor(
url: string,
{
headers = {},
customFetch,
}: {
headers?: Record<string, string>
customFetch?: Fetch
}
) {
this.url = url
this.headers = headers ?? {}

this.headers = headers
this.fetch = resolveFetch(customFetch)
}

Expand Down

0 comments on commit ad78a6b

Please sign in to comment.