Plato on Github
Report Home
ampersand/template/shared/client/models/me.js
Maintainability
90.41
Lines of code
28
Difficulty
10.67
Estimated Errors
0.20
Function weight
By Complexity
By SLOC
var AmpersandModel = require('ampersand-model'); module.exports = AmpersandModel.extend({ type: 'user', props: { id: ['string'], firstName: ['string', true, ''], lastName: ['string', true, ''], username: ['string'] }, derived: { fullName: { deps: ['firstName', 'lastName'], cache: true, fn: function () { return this.firstName + ' ' + this.lastName; } }, initials: { deps: ['firstName', 'lastName'], cache: true, fn: function () { return (this.firstName.charAt(0) + this.lastName.charAt(0)).toUpperCase(); } } } });