Functions

@system-inc/base-foundation · 515c140 · 3 symbols

getWsContext

function

Reads a value from the WebSocketInfo context bag using a typed key.

Accepts either a WebSocketInfo directly, or a RequestContext that may carry one (for middleware and other consumers that only hold the request context).

getWsContext(source: WebSocketInfo | RequestContext<unknown>, key: WebSocketInfoKey<T>): T | undefined

View source ↗

isWebSocketInfo(obj: unknown): obj is WebSocketInfo

View source ↗

setWsContext

function

Writes a value to the WebSocketInfo context bag using a typed key.

setWsContext(info: WebSocketInfo, key: WebSocketInfoKey<T>, value: T): void

View source ↗