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

Function isBodyInit

packages/effect/src/http/HttpServerRequest.ts:1108–1114  ·  view source on GitHub ↗
(u: unknown)

Source from the content-addressed store, hash-verified

1106const isFormData = (u: unknown): u is FormData => typeof FormData !== "undefined" && u instanceof FormData
1107
1108const isBodyInit = (u: unknown): u is BodyInit =>
1109 typeof u === "string" ||
1110 (typeof ArrayBuffer !== "undefined" && (u instanceof ArrayBuffer || ArrayBuffer.isView(u))) ||
1111 (typeof Blob !== "undefined" && u instanceof Blob) ||
1112 isFormData(u) ||
1113 (typeof URLSearchParams !== "undefined" && u instanceof URLSearchParams) ||
1114 isReadableStream(u)
1115
1116const textDecoder = new TextDecoder()
1117

Callers 2

rawBodyStreamFunction · 0.85
rawBodyBytesFunction · 0.85

Calls 2

isFormDataFunction · 0.85
isReadableStreamFunction · 0.70

Tested by

no test coverage detected