1
0
mirror of https://github.com/Unleash/unleash.git synced 2024-12-22 19:07:54 +01:00
unleash.unleash/lib/user.js
2020-02-20 08:34:06 +01:00

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' });
}
};