Skip to content

Commit

Permalink
Resolve Deno deprecation
Browse files Browse the repository at this point in the history
  • Loading branch information
sampsyo committed Feb 1, 2024
1 parent 12302cf commit 14c64e0
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions bril-ts/util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,12 @@
* Read all the data from stdin as a string.
*/
export async function readStdin(): Promise<string> {
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 {
Expand Down

0 comments on commit 14c64e0

Please sign in to comment.