models/menu.model.js
function(payload) {
    console.log('parse',this.defaults)
    var toReturn = {};
    //todo: will be better to use regular expressions to avoid full witespaces strings
    toReturn.caption = payload.caption || ' -x- ';
    toReturn.name = payload.name || 'test-action';
    toReturn.icon = payload.icon || 'fa-icon';
    toReturn.status=payload.status || false;
    return toReturn;
  }
function(payload) {
    console.log('parse',this.defaults)
    var toReturn = {};
    //todo: will be better to use regular expressions to avoid full witespaces strings
    toReturn.caption = payload.caption || ' -x- ';
    toReturn.name = payload.name || 'test-action';
    toReturn.icon = payload.icon || 'fa-icon';
    toReturn.status=payload.status || false;
    return toReturn;
  }
function ( payload ) { console . log ( 'parse' , this . defaults ) var toReturn = { } ; //todo: will be better to use regular expressions to avoid full witespaces strings toReturn . caption = payload . caption || ' -x- ' ; toReturn . name = payload . name || 'test-action' ; toReturn . icon = payload . icon || 'fa-icon' ; toReturn . status = payload . status || false ; return toReturn ; }
in case of some null properties we set for some defaults
in case of some null properties we set for some defaults