MCPcopy Create free account
hub / github.com/Effect-TS/effect / schemaPathParams

Function schemaPathParams

packages/effect/src/unstable/http/HttpRouter.ts:434–440  ·  view source on GitHub ↗
(
  schema: Schema.ConstraintCodec<A, I, RD, unknown>,
  options?: ParseOptions | undefined
)

Source from the content-addressed store, hash-verified

432 * @since 4.0.0
433 */
434export const schemaPathParams = <A, I extends Readonly<Record<string, string | undefined>>, RD>(
435 schema: Schema.ConstraintCodec<A, I, RD, unknown>,
436 options?: ParseOptions | undefined
437): Effect.Effect<A, Schema.SchemaError, RouteContext | RD> => {
438 const parse = Schema.decodeUnknownEffect(schema)
439 return Effect.flatMap(params, (_) => parse(_, options))
440}
441
442/**
443 * Creates a layer that accesses the current `HttpRouter` service and runs the

Callers

nothing calls this directly

Calls 1

parseFunction · 0.50

Tested by

no test coverage detected