MCPcopy
hub / github.com/upstash/jstack / use

Method use

packages/jstack/src/server/procedure.ts:191–200  ·  view source on GitHub ↗

* Adds a middleware function to the procedure chain. * * @see https://jstack.app/docs/backend/middleware * @param handler - A middleware function that can modify the context * * @example * ```ts * // Create a middleware that adds user data to context * const withUser = j.mi

(
    handler: MiddlewareFunction<Ctx, Return, E>,
  )

Source from the content-addressed store, hash-verified

189 * ```
190 */
191 use<T, Return = void>(
192 handler: MiddlewareFunction<Ctx, Return, E>,
193 ): Procedure<E, Ctx & T & Return, InputSchema, Incoming, Outgoing> {
194 return new Procedure<E, Ctx & T & Return, InputSchema, Incoming, Outgoing>(
195 [...this.middlewares, handler as any],
196 this.inputSchema,
197 this.incomingSchema,
198 this.outgoingSchema,
199 )
200 }
201
202 get<Return extends OptionalPromise<ResponseType<any>>>(
203 handler: ({

Callers 12

highlightCodeFunction · 0.80
index.tsFile · 0.80
jstack.tsFile · 0.80
search-router.tsFile · 0.80
index.tsFile · 0.80
index.tsFile · 0.80
jstack.tsFile · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected