Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
dsherret committed Sep 9, 2024
2 parents 4c699ac + fe63963 commit adbcdd9
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 13 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ jobs:

- name: Install deno
uses: denoland/setup-deno@v1
version: canary
with:
deno-version: canary

- uses: dprint/[email protected]
if: runner.os == 'Linux'
Expand Down
10 changes: 5 additions & 5 deletions src/command.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ class Deferred<T> {

interface ShellPipeWriterKindWithOptions {
kind: ShellPipeWriterKind;
options?: PipeOptions;
options?: StreamPipeOptions;
}

interface CommandBuilderStateCommand {
Expand Down Expand Up @@ -348,8 +348,8 @@ export class CommandBuilder implements PromiseLike<CommandResult> {

/** Set the stdout kind. */
stdout(kind: ShellPipeWriterKind): CommandBuilder;
stdout(kind: WritableStream<Uint8Array>, options?: PipeOptions): CommandBuilder;
stdout(kind: ShellPipeWriterKind, options?: PipeOptions): CommandBuilder {
stdout(kind: WritableStream<Uint8Array>, options?: StreamPipeOptions): CommandBuilder;
stdout(kind: ShellPipeWriterKind, options?: StreamPipeOptions): CommandBuilder {
return this.#newWithState((state) => {
if (state.combinedStdoutStderr && kind !== "piped" && kind !== "inheritPiped") {
throw new Error(
Expand All @@ -369,8 +369,8 @@ export class CommandBuilder implements PromiseLike<CommandResult> {

/** Set the stderr kind. */
stderr(kind: ShellPipeWriterKind): CommandBuilder;
stderr(kind: WritableStream<Uint8Array>, options?: PipeOptions): CommandBuilder;
stderr(kind: ShellPipeWriterKind, options?: PipeOptions): CommandBuilder {
stderr(kind: WritableStream<Uint8Array>, options?: StreamPipeOptions): CommandBuilder;
stderr(kind: ShellPipeWriterKind, options?: StreamPipeOptions): CommandBuilder {
return this.#newWithState((state) => {
if (state.combinedStdoutStderr && kind !== "piped" && kind !== "inheritPiped") {
throw new Error(
Expand Down
6 changes: 2 additions & 4 deletions src/console/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,11 +79,9 @@ function isTerminal(pipe: { isTerminal?(): boolean; rid?: number }) {
return pipe.isTerminal();
} else if (
pipe.rid != null &&
// deno-lint-ignore no-deprecated-deno-api
typeof Deno.isatty === "function"
typeof (Deno as any).isatty === "function"
) {
// deno-lint-ignore no-deprecated-deno-api
return Deno.isatty(pipe.rid);
return (Deno as any).isatty(pipe.rid);
} else {
throw new Error("Unsupported pipe.");
}
Expand Down
2 changes: 1 addition & 1 deletion src/request.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ Deno.test("$.request", (t) => {
let caughtErr: TimeoutError | undefined;
try {
await response.text();
} catch (err) {
} catch (err: any) {
caughtErr = err;
}
if (isNode) {
Expand Down
4 changes: 2 additions & 2 deletions src/request.ts
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,7 @@ export class RequestBuilder implements PromiseLike<RequestResponse> {
}

/** Pipes the response body to the provided writable stream. */
async pipeTo(dest: WritableStream<Uint8Array>, options?: PipeOptions): Promise<void> {
async pipeTo(dest: WritableStream<Uint8Array>, options?: StreamPipeOptions): Promise<void> {
const response = await this.fetch();
return await response.pipeTo(dest, options);
}
Expand Down Expand Up @@ -582,7 +582,7 @@ export class RequestResponse {
}

/** Pipes the response body to the provided writable stream. */
pipeTo(dest: WritableStream<Uint8Array>, options?: PipeOptions): Promise<void> {
pipeTo(dest: WritableStream<Uint8Array>, options?: StreamPipeOptions): Promise<void> {
return this.#withReturnHandling(() => this.readable.pipeTo(dest, options));
}

Expand Down

0 comments on commit adbcdd9

Please sign in to comment.