MCPcopy Index your code
hub / github.com/Effect-TS/effect / schemaParams

Function schemaParams

packages/platform/src/internal/httpRouter.ts:120–133  ·  view source on GitHub ↗
(
  schema: Schema.Schema<A, I, R>,
  options?: ParseOptions | undefined
)

Source from the content-addressed store, hash-verified

118
119/** @internal */
120export const schemaParams = <A, I extends Readonly<Record<string, string | ReadonlyArray<string> | undefined>>, R>(
121 schema: Schema.Schema<A, I, R>,
122 options?: ParseOptions | undefined
123) => {
124 const parse = Schema.decodeUnknown(schema, options)
125 return Effect.flatMap(
126 Effect.context<ServerRequest.ParsedSearchParams | Router.RouteContext>(),
127 (context) => {
128 const searchParams = Context.get(context, ServerRequest.ParsedSearchParams)
129 const routeContext = Context.get(context, RouteContext)
130 return parse({ ...searchParams, ...routeContext.params })
131 }
132 )
133}
134
135/** @internal */
136export const schemaPathParams = <A, I extends Readonly<Record<string, string | undefined>>, R>(

Callers

nothing calls this directly

Calls 3

parseFunction · 0.70
contextMethod · 0.65
getMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…