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

Function isBodyInit

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

Source from the content-addressed store, hash-verified

1001const isFormData = (u: unknown): u is FormData => typeof FormData !== "undefined" && u instanceof FormData
1002
1003const isBodyInit = (u: unknown): u is BodyInit =>
1004 typeof u === "string" ||
1005 (typeof ArrayBuffer !== "undefined" && (u instanceof ArrayBuffer || ArrayBuffer.isView(u))) ||
1006 (typeof Blob !== "undefined" && u instanceof Blob) ||
1007 isFormData(u) ||
1008 (typeof URLSearchParams !== "undefined" && u instanceof URLSearchParams) ||
1009 isReadableStream(u)
1010
1011const textDecoder = new TextDecoder()
1012

Callers 2

rawBodyStreamFunction · 0.85
rawBodyBytesFunction · 0.85

Calls 2

isFormDataFunction · 0.85
isReadableStreamFunction · 0.70

Tested by

no test coverage detected