userSchema.pre('save', async function(done) {
if (this.isModified('pass')) {
const hashed = await Password.toHash(this.get('pass'));
this.set('pass', hashed);
}
done();
});
I am getting the following error from "this":
'this' implicitly has type 'any' because it does not have a type annotation.ts(2683)
I heard the problem came from the arrow key, but I am not using an arrow key for the callback function? I am still getting an error. What gives?
I am also getting an error from "done":
Parameter 'done' implicitly has an 'any' type.ts(7006)
Could it be some kind of bug with Visual Studio Code?