mirror of
https://github.com/microsoft/TypeScript-Node-Starter.git
synced 2025-11-08 16:17:37 +00:00
Change size existence check to default value
Using default value for size param in gravatar method is more convenient.
This commit is contained in:
@@ -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`;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user