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

Function schemaBodyJson

packages/effect/src/unstable/http/HttpServerRequest.ts:245–251  ·  view source on GitHub ↗
(
  schema: Schema.ConstraintDecoder<A, RD>,
  options?: ParseOptions | undefined
)

Source from the content-addressed store, hash-verified

243 * @since 4.0.0
244 */
245export const schemaBodyJson = <A, RD>(
246 schema: Schema.ConstraintDecoder<A, RD>,
247 options?: ParseOptions | undefined
248): Effect.Effect<A, HttpServerError | Schema.SchemaError, HttpServerRequest | RD> => {
249 const parse = HttpIncomingMessage.schemaBodyJson(schema, options)
250 return Effect.flatMap(HttpServerRequest, parse)
251}
252
253const isMultipart = (request: HttpServerRequest) =>
254 request.headers["content-type"]?.toLowerCase().includes("multipart/form-data") === true ||

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected