-
-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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: make mongoose typings work without esmModuleInterop true #11695
fix: make mongoose typings work without esmModuleInterop true #11695
Conversation
This was kind of messy Bug. To get it work without esmModuleInterOp I had to move the imports into the namespace and do the default export in the namespace. Exporting a default forces you to explicitly export all types, interfaces,namespaces and classes in that specific namespace. Moved NativeError and NativeDate out of the mongoose-namespace, as that was clearly wrong as we dont export such classes. Changed two "classes" (SchemaTypeOptions, MixedSchemaTypeOptions) to interfaces, as they can not be instantiated. Fixed also validateSync typing and modified model.validate to properly handle pathsToValidate (normalized the behaviour). |
At first glance looks good. I'll do some quick tests this PR over the next couple of days. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks 👍
Resolves #11664