Skip to content

Commit c2ad768

Browse files
committed
Update parseOptions
1 parent 93ba264 commit c2ad768

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

src/lib/seam/connect/client.ts

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,7 @@ export class SeamHttp {
1818
#legacy: boolean
1919

2020
constructor(apiKeyOrOptions: string | SeamHttpOptions) {
21-
const options = parseOptions(
22-
typeof apiKeyOrOptions === 'string'
23-
? { apiKey: apiKeyOrOptions }
24-
: apiKeyOrOptions,
25-
)
26-
21+
const options = parseOptions(apiKeyOrOptions)
2722
this.#legacy = options.enableLegacyMethodBehaivor
2823

2924
// TODO: axiosRetry? Allow options to configure this if so
@@ -78,7 +73,14 @@ export class SeamHttp {
7873
}
7974
}
8075

81-
const parseOptions = (options: SeamHttpOptions): Required<SeamHttpOptions> => {
76+
const parseOptions = (
77+
apiKeyOrOptions: string | SeamHttpOptions,
78+
): Required<SeamHttpOptions> => {
79+
const options =
80+
typeof apiKeyOrOptions === 'string'
81+
? { apiKey: apiKeyOrOptions }
82+
: apiKeyOrOptions
83+
8284
const endpoint =
8385
options.endpoint ??
8486
globalThis.process?.env?.['SEAM_ENDPOINT'] ??

0 commit comments

Comments
 (0)