Versions
- System: linux / macos / windows
- NodeJS: 0.0.0
- Typescript: 0.0.0
- Compiler / Transpiler: tsc / ts-node / ts-jest
- Typegoose(NPM): 11.4.0
- Typegoose(GIT): commithash
- mongoose: 0.0.0
- mongodb: 0.0.0
- nestjs / nestjs-typegoose: 0.0.0 / 0.0.0
- grahpql / type-graphql: 0.0.0 / 0.0.0
What is the Problem?
Typegoose currently does not properly handle explicit functions function() { } instead of () => {}
Code Example
class Testy {
@prop({
type: function () {
return String;
},
})
public test?: any;
}
Do you know why it happens?
because utils.ts:isConstructor tests for !isNullOrUndefined(obj.prototype?.constructor?.name), which exists in function() { } but not in () => {}
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:isConstructortests for!isNullOrUndefined(obj.prototype?.constructor?.name), which exists infunction() { }but not in() => {}