From 14c64e04556ba7c48e29b034d11c83ff0d40e471 Mon Sep 17 00:00:00 2001 From: Adrian Sampson Date: Thu, 1 Feb 2024 14:37:14 -0500 Subject: [PATCH] Resolve Deno deprecation --- bril-ts/util.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/bril-ts/util.ts b/bril-ts/util.ts index 40b0dfbb9..5e5a74932 100644 --- a/bril-ts/util.ts +++ b/bril-ts/util.ts @@ -2,8 +2,12 @@ * Read all the data from stdin as a string. */ export async function readStdin(): Promise { - const buf = await Deno.readAll(Deno.stdin); - return (new TextDecoder()).decode(buf); + let buf = ""; + const dec = new TextDecoder(); + for await (const chunk of Deno.stdin.readable) { + buf += dec.decode(chunk); + } + return buf; } export function unreachable(x: never): never {