mirror of
https://github.com/Unleash/unleash.git
synced 2025-01-01 00:08:27 +01:00
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' });
|
||
|
}
|
||
|
};
|