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

Incorrect typescript typings (Document.validateSync return type) #10147

Closed
michaln-q opened this issue Apr 16, 2021 · 0 comments · Fixed by #10175
Closed

Incorrect typescript typings (Document.validateSync return type) #10147

michaln-q opened this issue Apr 16, 2021 · 0 comments · Fixed by #10175
Assignees
Labels
typescript Types or Types-test related issue / Pull Request
Milestone

Comments

@michaln-q
Copy link
Contributor

Do you want to request a feature or report a bug?
Bug
What is the current behavior?
Current typings provided here: https://github.com/Automattic/mongoose/blob/master/index.d.ts#L599 don't match return type described here: https://mongoosejs.com/docs/api.html#document_Document-validateSync (ValidationError !== NativeError)

What is the expected behavior?
That function returns ValidationError instead of NativeError
What are the versions of Node.js, Mongoose and MongoDB you are using? Note that "latest" is not a version.
Mongoose: 5.12.3
Node: 12.15.1
Typescript: 3.8.3
MongoDB: 3.3

I'm happy to provide a PR if you agree this is a bug.

@IslandRhythms IslandRhythms added seen typescript Types or Types-test related issue / Pull Request labels Apr 16, 2021
@vkarpov15 vkarpov15 added this to the 5.12.7 milestone Apr 23, 2021
@vkarpov15 vkarpov15 removed the seen label Apr 23, 2021
vkarpov15 added a commit that referenced this issue Apr 26, 2021
fix(index.d.ts): change document.validateSync return type to Validati…
@vkarpov15 vkarpov15 modified the milestones: 5.12.7, 5.12.6 Apr 27, 2021
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
Development

Successfully merging a pull request may close this issue.

3 participants