Skip to content

Commit

Permalink
chore: add ts-ignores for Deno.consoleSize() API (denoland#2808)
Browse files Browse the repository at this point in the history
  • Loading branch information
bartlomieju committed Oct 25, 2022
1 parent 4de657f commit 91cebba
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
6 changes: 6 additions & 0 deletions node/_process/streams.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ function createWritableStdioStream(writer, name) {
configurable: true,
get: () =>
Deno.isatty?.(writer?.rid)
// TODO(bartlomieju):
// @ts-ignore Deno.consoleSize is getting stabilized and its signature changes
? Deno.consoleSize?.(writer?.rid).columns
: undefined,
},
Expand All @@ -50,6 +52,8 @@ function createWritableStdioStream(writer, name) {
configurable: true,
get: () =>
Deno.isatty?.(writer?.rid)
// TODO(bartlomieju):
// @ts-ignore Deno.consoleSize is getting stabilized and its signature changes
? Deno.consoleSize?.(writer?.rid).rows
: undefined,
},
Expand All @@ -63,6 +67,8 @@ function createWritableStdioStream(writer, name) {
configurable: true,
value: () =>
Deno.isatty?.(writer?.rid)
// TODO(bartlomieju):
// @ts-ignore Deno.consoleSize is getting stabilized and its signature changes
? Object.values(Deno.consoleSize?.(writer?.rid))
: undefined,
},
Expand Down
4 changes: 4 additions & 0 deletions node/process_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -330,6 +330,8 @@ Deno.test({
assertEquals(process.stdout.fd, Deno.stdout.rid);
const isTTY = Deno.isatty(Deno.stdout.rid);
assertEquals(process.stdout.isTTY, isTTY);
// TODO(bartlomieju):
// @ts-ignore Deno.consoleSize is getting stabilized and its signature changes
const consoleSize = isTTY ? Deno.consoleSize(Deno.stdout.rid) : undefined;
assertEquals(process.stdout.columns, consoleSize?.columns);
assertEquals(process.stdout.rows, consoleSize?.rows);
Expand Down Expand Up @@ -358,6 +360,8 @@ Deno.test({
assertEquals(process.stderr.fd, Deno.stderr.rid);
const isTTY = Deno.isatty(Deno.stderr.rid);
assertEquals(process.stderr.isTTY, isTTY);
// TODO(bartlomieju):
// @ts-ignore Deno.consoleSize is getting stabilized and its signature changes
const consoleSize = isTTY ? Deno.consoleSize(Deno.stderr.rid) : undefined;
assertEquals(process.stderr.columns, consoleSize?.columns);
assertEquals(process.stderr.rows, consoleSize?.rows);
Expand Down

0 comments on commit 91cebba

Please sign in to comment.