hardlounge/src/models/user.js
2016-04-07 16:06:03 -04:00

15 lines
260 B
JavaScript

var _ = require("lodash");
module.exports = User;
function User(attr) {
// TODO: Remove this
attr.name = attr.name || attr.nick;
attr.mode = attr.mode || (attr.modes && attr.modes[0]) || "";
_.merge(this, _.extend({
mode: "",
name: ""
}, attr));
}