summaryrefslogtreecommitdiff
path: root/std/io/readers.ts
diff options
context:
space:
mode:
Diffstat (limited to 'std/io/readers.ts')
-rw-r--r--std/io/readers.ts10
1 files changed, 5 insertions, 5 deletions
diff --git a/std/io/readers.ts b/std/io/readers.ts
index 8a567d7d1..10069986c 100644
--- a/std/io/readers.ts
+++ b/std/io/readers.ts
@@ -9,12 +9,12 @@ export class StringReader implements Reader {
constructor(private readonly s: string) {}
- read(p: Uint8Array): Promise<number | Deno.EOF> {
+ read(p: Uint8Array): Promise<number | null> {
const n = Math.min(p.byteLength, this.buf.byteLength - this.offs);
p.set(this.buf.slice(this.offs, this.offs + n));
this.offs += n;
if (n === 0) {
- return Promise.resolve(Deno.EOF);
+ return Promise.resolve(null);
}
return Promise.resolve(n);
}
@@ -29,11 +29,11 @@ export class MultiReader implements Reader {
this.readers = readers;
}
- async read(p: Uint8Array): Promise<number | Deno.EOF> {
+ async read(p: Uint8Array): Promise<number | null> {
const r = this.readers[this.currentIndex];
- if (!r) return Deno.EOF;
+ if (!r) return null;
const result = await r.read(p);
- if (result === Deno.EOF) {
+ if (result === null) {
this.currentIndex++;
return 0;
}