mirror of
https://github.com/Unleash/unleash.git
synced 2024-12-22 19:07:54 +01:00
f4feab89f3
Closes: #261, #233, #232, #231
15 lines
369 B
JavaScript
15 lines
369 B
JavaScript
'use strict';
|
|
|
|
const gravatar = require('gravatar');
|
|
const assert = require('assert');
|
|
|
|
module.exports = class User {
|
|
constructor({ name, email, imageUrl } = {}) {
|
|
assert(email, 'Email is required');
|
|
this.email = email;
|
|
this.name = name;
|
|
this.imageUrl =
|
|
imageUrl || gravatar.url(email, { s: '42', d: 'retro' });
|
|
}
|
|
};
|