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

fix(index): export ConnectionStates #11133

Merged
merged 1 commit into from
Dec 24, 2021

Conversation

orgads
Copy link
Contributor

@orgads orgads commented Dec 23, 2021

Summary
It is declared as an enum in ts definitions, but did not really work.

Examples
This code passes ts compilation, but crashes on runtime:

import { Connection, ConnectionStates } from 'mongoose';
// ...
return (this.connection.readyState !== ConnectionStates.connected);

It is declared as an enum in ts definitions, but did not really work.
Copy link
Collaborator

@vkarpov15 vkarpov15 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks 👍

@vkarpov15 vkarpov15 added this to the 6.1.4 milestone Dec 24, 2021
@vkarpov15 vkarpov15 merged commit b6eb341 into Automattic:master Dec 24, 2021
@orgads orgads deleted the connection-states branch December 24, 2021 03:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants