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

Function schemaSearchParams

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

Source from the content-addressed store, hash-verified

265 * @since 4.0.0
266 */
267export const schemaSearchParams = <
268 A,
269 I extends Readonly<Record<string, string | ReadonlyArray<string> | undefined>>,
270 RD
271>(
272 schema: Schema.ConstraintCodec<A, I, RD, unknown>,
273 options?: ParseOptions | undefined
274): Effect.Effect<A, Schema.SchemaError, ParsedSearchParams | RD> => {
275 const parse = Schema.decodeUnknownEffect(schema)
276 return Effect.flatMap(ParsedSearchParams, (params) => parse(params, options))
277}
278/**
279 * Reads the current request body as JSON and decodes it with the supplied schema.
280 *

Callers

nothing calls this directly

Calls 1

parseFunction · 0.50

Tested by

no test coverage detected