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

Function getFormDataBody

packages/effect/src/unstable/http/HttpServerRequest.ts:853–865  ·  view source on GitHub ↗
(request: HttpServerRequest)

Source from the content-addressed store, hash-verified

851}
852
853const getFormDataBody = (request: HttpServerRequest): FormData | undefined => {
854 if (!HttpClientRequest.isHttpClientRequest(request.source)) {
855 return undefined
856 }
857 const body = request.source.body
858 if (body._tag === "FormData") {
859 return body.formData
860 }
861 if (body._tag === "Raw" && isFormData(body.body)) {
862 return body.body
863 }
864 return undefined
865}
866
867const rawBodyStream = (request: HttpServerRequest, body: unknown): Stream.Stream<Uint8Array, HttpServerError> => {
868 if (body instanceof Request) {

Callers 2

isMultipartFunction · 0.85
toClientBodyFunction · 0.85

Calls 1

isFormDataFunction · 0.85

Tested by

no test coverage detected