Skip to content

Commit

Permalink
improve cast type
Browse files Browse the repository at this point in the history
  • Loading branch information
unnoq committed Dec 29, 2024
1 parent f66ab3b commit e487428
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/client/src/adapters/fetch/orpc-link.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export class ORPCLink<TClientContext> implements ClientLink<TClientContext> {
headers.append(ORPC_HANDLER_HEADER, ORPC_HANDLER_VALUE)

// clientContext only undefined when context is undefinable so we can safely cast it
const clientContext = options.context as Exclude<typeof options.context, undefined>
const clientContext = options.context as typeof options.context & { context: TClientContext }

let customHeaders = await this.options.headers?.(input, clientContext)
customHeaders = customHeaders instanceof Headers ? customHeaders : new Headers(customHeaders)
Expand Down

0 comments on commit e487428

Please sign in to comment.