function readBytesCapped
readBytesCapped(
res: Response,
maxBytes: number
): Promise<Uint8Array>

Reads the body of res up to maxBytes; the rest is cancelled, never downloaded. The image proxy reads through it, and readTextCapped.

Parameters

maxBytes: number

Return Type

Promise<Uint8Array>

Usage

import { readBytesCapped } from "api/remote/fetch.ts";