node: stream.finished: err is optional

This commit is contained in:
Piotr Roszatycki 2018-09-13 10:08:55 +02:00
parent f4b9e5acaa
commit a649bec809
2 changed files with 3 additions and 3 deletions

View File

@ -6415,7 +6415,7 @@ declare module "stream" {
export class PassThrough extends Transform { }
export function finished(stream: NodeJS.ReadableStream | NodeJS.WritableStream | NodeJS.ReadWriteStream, callback?: (err: NodeJS.ErrnoException) => void): () => void;
export function finished(stream: NodeJS.ReadableStream | NodeJS.WritableStream | NodeJS.ReadWriteStream, callback: (err?: NodeJS.ErrnoException) => void): () => void;
export namespace finished {
export function __promisify__(stream: NodeJS.ReadableStream | NodeJS.WritableStream | NodeJS.ReadWriteStream): Promise<void>;
}

View File

@ -1124,10 +1124,10 @@ function simplified_stream_ctor_test() {
}
function streamPipelineFinished() {
const cancel = stream.finished(process.stdin, (err: Error) => {});
const cancel = stream.finished(process.stdin, (err?: Error) => {});
cancel();
stream.pipeline(process.stdin, process.stdout, (err: Error) => {});
stream.pipeline(process.stdin, process.stdout, (err?: Error) => {});
}
async function asyncStreamPipelineFinished() {