@adviser/cement - v0.0.0
    Preparing search index...

    Function stream2uint8array

    • Converts a ReadableStream of Uint8Array chunks to a single Uint8Array.

      Delegates to the given strategy so callers can trade runtime against memory footprint. Defaults to stream2uint8arrayGrowResizable when the runtime supports resizable ArrayBuffers, otherwise to stream2uint8arrayChunkAndJoin.

      Parameters

      • Optionalstream: ReadableStream<Uint8Array<ArrayBufferLike>>

        The stream to consume (returns an empty array if undefined)

      • strategy: Stream2Uint8ArrayStrategy = ...

        Implementation used to consume the stream

      Returns Promise<Uint8Array<ArrayBufferLike>>

      Promise resolving to the concatenated bytes

      const bytes = await stream2uint8array(response.body);

      // Cap the resizable buffer explicitly
      const capped = await stream2uint8array(response.body, fnStream2uint8arrayGrowResizable(8 * 1024 * 1024));