1
0
mirror of https://github.com/microsoft/TypeScript-Node-Starter.git synced 2025-11-08 16:17:37 +00:00

Merge pull request #135 from KonradLinkowski/patch-1

Change size existence check to default value
This commit is contained in:
Orta
2019-06-19 14:45:15 -07:00
committed by GitHub

View File

@@ -77,10 +77,7 @@ userSchema.methods.comparePassword = comparePassword;
/**
* Helper method for getting user's gravatar.
*/
userSchema.methods.gravatar = function (size: number) {
if (!size) {
size = 200;
}
userSchema.methods.gravatar = function (size: number = 200) {
if (!this.email) {
return `https://gravatar.com/avatar/?s=${size}&d=retro`;
}