Skip to content

Commit b6a63df

Browse files
authored
fix(NODE-2370): correct a return type of hasNext() (#3058)
1 parent 15fe9aa commit b6a63df

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/change_stream.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -310,7 +310,9 @@ export class ChangeStream<TSchema extends Document = Document> extends TypedEven
310310
}
311311

312312
/** Check if there is any document still available in the Change Stream */
313-
hasNext(callback?: Callback): Promise<void> | void {
313+
hasNext(): Promise<boolean>;
314+
hasNext(callback: Callback<boolean>): void;
315+
hasNext(callback?: Callback): Promise<boolean> | void {
314316
setIsIterator(this);
315317
return maybePromise(callback, cb => {
316318
getCursor(this, (err, cursor) => {

0 commit comments

Comments
 (0)