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

Function uint8Array

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

Source from the content-addressed store, hash-verified

178 * @since 4.0.0
179 */
180export const uint8Array = (
181 body: Uint8Array,
182 options?: Options.WithContentType
183): HttpServerResponse => {
184 const headers = options?.headers
185 ? Headers.fromInput(options.headers)
186 : Headers.empty
187 return makeResponse({
188 status: options?.status ?? 200,
189 statusText: options?.statusText,
190 headers,
191 cookies: options?.cookies ?? Cookies.empty,
192 body: Body.uint8Array(body, getContentType(options, headers))
193 })
194}
195
196const getContentType = (
197 options: Options | undefined,

Callers

nothing calls this directly

Calls 2

getContentTypeFunction · 0.85
makeResponseFunction · 0.70

Tested by

no test coverage detected