MCPcopy Create free account
hub / github.com/middleapi/orpc / $context

Method $context

packages/server/src/builder.ts:80–91  ·  view source on GitHub ↗

* Set or override the initial context. * * @see https://orpc.dev/docs/context Context Docs

()

Source from the content-addressed store, hash-verified

78 * @see {@link https://orpc.dev/docs/context Context Docs}
79 */
80 $context<U extends Context>(): Builder<U & Record<never, never>, U, TInputSchema, TOutputSchema, TErrorMap, TMeta> {
81 /**
82 * We need `& Record<never, never>` to deal with `has no properties in common with type` error
83 */
84
85 return new Builder({
86 ...this['~orpc'],
87 middlewares: [],
88 inputValidationIndex: fallbackConfig('initialInputValidationIndex', this['~orpc'].config.initialInputValidationIndex),
89 outputValidationIndex: fallbackConfig('initialOutputValidationIndex', this['~orpc'].config.initialOutputValidationIndex),
90 })
91 }
92
93 /**
94 * Sets or overrides the initial meta.

Calls 1

fallbackConfigFunction · 0.90

Tested by

no test coverage detected