Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BREAKING refactor(io): single-export files #2975

Merged
merged 1 commit into from
Dec 5, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 0 additions & 53 deletions io/_iotest.ts

This file was deleted.

29 changes: 29 additions & 0 deletions io/_test_common.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
// Copyright 2018-2022 the Deno authors. All rights reserved. MIT license.

import type { Reader } from "./types.d.ts";

export const MIN_READ_BUFFER_SIZE = 16;
export const bufsizes: number[] = [
0,
MIN_READ_BUFFER_SIZE,
23,
32,
46,
64,
93,
128,
1024,
4096,
];

export class BinaryReader implements Reader {
index = 0;

constructor(private bytes: Uint8Array = new Uint8Array(0)) {}

read(p: Uint8Array): Promise<number | null> {
p.set(this.bytes.subarray(this.index, p.byteLength));
this.index += p.byteLength;
return Promise.resolve(p.byteLength);
}
}
Loading