You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
i dont think this is properly fixable because there is no universal way to differentiate between native functions (and mocked native functions) and other types like mongoose's Schema.Types.* and Types.* which are callable without new (and dont have class in their toString representation)
because of those same reasons i also dont think there is a proper way to add a error for this
Versions
What is the Problem?
Typegoose currently does not properly handle explicit functions
function() { }
instead of() => {}
Code Example
Do you know why it happens?
because
utils.ts:isConstructor
tests for!isNullOrUndefined(obj.prototype?.constructor?.name)
, which exists infunction() { }
but not in() => {}
The text was updated successfully, but these errors were encountered: