Skip to content

Commit

Permalink
Merge pull request #310 from sampsyo/deno-deprecation
Browse files Browse the repository at this point in the history
Resolve Deno deprecation
  • Loading branch information
sampsyo committed Feb 6, 2024
2 parents 12302cf + 14c64e0 commit fe9ebf1
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 fe9ebf1

Please sign in to comment.