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

Function uint8Array

packages/effect/src/unstable/http/HttpServerResponse.ts:164–178  ·  view source on GitHub ↗
(
  body: Uint8Array,
  options?: Options.WithContentType
)

Source from the content-addressed store, hash-verified

162 * @since 4.0.0
163 */
164export const uint8Array = (
165 body: Uint8Array,
166 options?: Options.WithContentType
167): HttpServerResponse => {
168 const headers = options?.headers
169 ? Headers.fromInput(options.headers)
170 : Headers.empty
171 return makeResponse({
172 status: options?.status ?? 200,
173 statusText: options?.statusText,
174 headers,
175 cookies: options?.cookies ?? Cookies.empty,
176 body: Body.uint8Array(body, getContentType(options, headers))
177 })
178}
179
180const getContentType = (
181 options: Options | undefined,

Callers

nothing calls this directly

Calls 2

getContentTypeFunction · 0.85
makeResponseFunction · 0.70

Tested by

no test coverage detected