Skip to content

Commit

Permalink
fix(NODE-2370): correct a return type of hasNext() (#3058)
Browse files Browse the repository at this point in the history
  • Loading branch information
wegylexy committed Nov 29, 2021
1 parent 15fe9aa commit b6a63df
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/change_stream.ts
Expand Up @@ -310,7 +310,9 @@ export class ChangeStream<TSchema extends Document = Document> extends TypedEven
}

/** Check if there is any document still available in the Change Stream */
hasNext(callback?: Callback): Promise<void> | void {
hasNext(): Promise<boolean>;
hasNext(callback: Callback<boolean>): void;
hasNext(callback?: Callback): Promise<boolean> | void {
setIsIterator(this);
return maybePromise(callback, cb => {
getCursor(this, (err, cursor) => {
Expand Down

0 comments on commit b6a63df

Please sign in to comment.