···55 /** total length of the data source */
66 length: number;
77 /** reads data from the specified offset and length */
88- read(offset: number, length?: number): Promise<ReadableStream<Uint8Array>>;
88+ read(offset: number, length?: number): Promise<ReadableStream<Uint8Array<ArrayBuffer>>>;
99}
+2-2
lib/unzip.ts
···176176 * reads the entry content as bytes
177177 * @returns the content as Uint8Array
178178 */
179179- async bytes(): Promise<Uint8Array> {
179179+ async bytes(): Promise<Uint8Array<ArrayBuffer>> {
180180 return await read(this.body, this.size);
181181 }
182182···185185 * @returns an ArrayBuffer
186186 */
187187 async arrayBuffer(): Promise<ArrayBuffer> {
188188- const bytes = await this.bytes() as Uint8Array<ArrayBuffer>;
188188+ const bytes = await this.bytes();
189189190190 // if bytes covers the entire buffer, return it directly
191191 if (bytes.byteOffset === 0 && bytes.byteLength === bytes.buffer.byteLength) {
+5-2
lib/utils/buffer.ts
···33export const textEncoder = new TextEncoder();
44export const textDecoder = new TextDecoder();
5566-export function concat(arrays: Uint8Array[], size?: number): Uint8Array {
66+export function concat(arrays: Uint8Array[], size?: number): Uint8Array<ArrayBuffer> {
77 let written = 0;
8899 // deno-lint-ignore prefer-const
···2929 return buffer;
3030}
31313232-export async function read(stream: ReadableStream<Uint8Array>, size: number): Promise<Uint8Array> {
3232+export async function read(
3333+ stream: ReadableStream<Uint8Array>,
3434+ size: number,
3535+): Promise<Uint8Array<ArrayBuffer>> {
3336 const buffer = new Uint8Array(size);
34373538 let read = 0;