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

Function toUint8Array

packages/platform/node-shared/src/NodeStream.ts:323–329  ·  view source on GitHub ↗
(
  readable: LazyArg<Readable | NodeJS.ReadableStream>,
  options?: {
    readonly onError?: (error: unknown) => E
    readonly maxBytes?: SizeInput | undefined
  }
)

Source from the content-addressed store, hash-verified

321 * @since 4.0.0
322 */
323export const toUint8Array = <E = Cause.UnknownError>(
324 readable: LazyArg<Readable | NodeJS.ReadableStream>,
325 options?: {
326 readonly onError?: (error: unknown) => E
327 readonly maxBytes?: SizeInput | undefined
328 }
329): Effect.Effect<Uint8Array, E> => Effect.map(toArrayBuffer(readable, options), (buffer) => new Uint8Array(buffer))
330
331// ----------------------------------------------------------------------------
332// internal

Callers

nothing calls this directly

Calls 2

toArrayBufferFunction · 0.70
mapMethod · 0.45

Tested by

no test coverage detected