Skip to content

Commit 10ace4f

Browse files
authored
feat(client, server): allow numbers and symbols as context keys (#312)
<!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **Refactor** - Improved context data type definitions to support a wider range of key formats (including numbers and symbols) for enhanced flexibility. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
1 parent d1f8ea3 commit 10ace4f

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

packages/client/src/types.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import type { PromiseWithError } from '@orpc/shared'
33
export type HTTPPath = `/${string}`
44
export type HTTPMethod = 'GET' | 'POST' | 'PUT' | 'DELETE' | 'PATCH'
55

6-
export type ClientContext = Record<string, any>
6+
export type ClientContext = Record<PropertyKey, any>
77

88
export type FriendlyClientOptions<TClientContext extends ClientContext> =
99
& { signal?: AbortSignal, lastEventId?: string | undefined }

packages/server/src/context.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
export type Context = Record<string, any>
1+
export type Context = Record<PropertyKey, any>
22

33
export type MergedInitialContext<
44
TInitial extends Context,

0 commit comments

Comments
 (0)