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

Function getFormDataBody

packages/effect/src/http/HttpServerRequest.ts:925–937  ·  view source on GitHub ↗
(request: HttpServerRequest)

Source from the content-addressed store, hash-verified

923}
924
925const getFormDataBody = (request: HttpServerRequest): FormData | undefined => {
926 if (!HttpClientRequest.isHttpClientRequest(request.source)) {
927 return undefined
928 }
929 const body = request.source.body
930 if (body._tag === "FormData") {
931 return body.formData
932 }
933 if (body._tag === "Raw" && isFormData(body.body)) {
934 return body.body
935 }
936 return undefined
937}
938
939const rawBodyStream = (request: HttpServerRequest, body: unknown): Stream.Stream<Uint8Array, HttpServerError> => {
940 if (body instanceof Request) {

Callers 2

isMultipartFunction · 0.85
toClientBodyFunction · 0.85

Calls 1

isFormDataFunction · 0.85

Tested by

no test coverage detected