Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

types(cursor): correct asyncIterator and asyncDispose for TypeScript with lib: 'esnext' #15038

Merged
merged 1 commit into from
Nov 14, 2024

Conversation

vkarpov15
Copy link
Collaborator

Fix #14976

Summary

Add Symbol.asyncDispose() to querycursors and correct the return type of Symbol.asyncIterator to indicate that it returns a cursor with different return type. I had to add a new generic NextResultType to work around the issue where next() always returns DocType | null.

No need for any runtime changes AFAIK because Node.js streams already support AsyncDispose

Examples

@hasezoey hasezoey added the typescript Types or Types-test related issue / Pull Request label Nov 14, 2024
@vkarpov15 vkarpov15 added this to the 8.8.2 milestone Nov 14, 2024
@vkarpov15 vkarpov15 merged commit 445a76d into master Nov 14, 2024
5 checks passed
@vkarpov15 vkarpov15 deleted the vkarpov15/gh-14976 branch November 14, 2024 15:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
typescript Types or Types-test related issue / Pull Request
Projects
None yet
2 participants