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

Function text

packages/effect/src/unstable/http/HttpBody.ts:278–279  ·  view source on GitHub ↗
(body: string, contentType?: string)

Source from the content-addressed store, hash-verified

276 * @since 4.0.0
277 */
278export const text = (body: string, contentType?: string): Uint8Array =>
279 uint8Array(encoder.encode(body), contentType ?? "text/plain")
280
281/**
282 * Creates a JSON HTTP body using `JSON.stringify`, throwing if serialization fails.

Callers 3

jsonUnsafeFunction · 0.70
jsonFunction · 0.70
urlParamsFunction · 0.70

Calls 1

uint8ArrayFunction · 0.70

Tested by

no test coverage detected