Skip to content

Commit ad78a6b

Browse files
committed
fix: put all optional params in an object
1 parent 0f9a079 commit ad78a6b

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

src/index.ts

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,21 @@ import { Fetch, FunctionInvokeOptions } from './types'
33

44
export class FunctionsClient {
55
protected url: string
6-
protected headers: { [key: string]: string }
6+
protected headers: Record<string, string>
77
protected fetch: Fetch
88

9-
constructor(url: string, headers?: { [key: string]: string }, customFetch?: Fetch) {
9+
constructor(
10+
url: string,
11+
{
12+
headers = {},
13+
customFetch,
14+
}: {
15+
headers?: Record<string, string>
16+
customFetch?: Fetch
17+
}
18+
) {
1019
this.url = url
11-
this.headers = headers ?? {}
12-
20+
this.headers = headers
1321
this.fetch = resolveFetch(customFetch)
1422
}
1523

0 commit comments

Comments
 (0)