(Bug) Type definitions: new signature for cursor.eachAsync() results in non-inferrable type arguments #10135
Labels
typescript
Types or Types-test related issue / Pull Request
Milestone
Do you want to request a feature or report a bug?
Bug.
What is the current behavior?
Upgraded:
mongoose ^5.11.14 → ^5.12.3
After upgrading to 5.12.x, Compilation fails when using the
Cursor.eachAsync()
method with (previously) valid type arguments:If the current behavior is a bug, please provide the steps to reproduce.
What is the expected behavior?
The type should be narrowed based on the method signature used. If not using batch processing, the type should not be an Array type (or an optional array type).
What are the versions of Node.js, Mongoose and MongoDB you are using? Note that "latest" is not a version.
5.12.3
This was changed in #9902 afaik, and results in a breaking API change as compilation fails with what used to be proper usage of the
eachAsync
API.The text was updated successfully, but these errors were encountered: