util.js
function(settings, styles) {
  if (_.isArray(styles) && styles.length > 0) {
    _.each(styles, function(obj) {
      if (!_.has(obj, 'name')) {
        return;
      }
      var style = _.findWhere(settings.styles, { name: obj.name });
      if (!_.isUndefined(style)) {
        style.configure(obj);
      } else {
        settings.styles.push( toGrawlixStyle(obj) );
      }
    });
  }
  return settings;
}
function(settings, styles) {
  if (_.isArray(styles) && styles.length > 0) {
    _.each(styles, function(obj) {
      if (!_.has(obj, 'name')) {
        return;
      }
      var style = _.findWhere(settings.styles, { name: obj.name });
      if (!_.isUndefined(style)) {
        style.configure(obj);
      } else {
        settings.styles.push( toGrawlixStyle(obj) );
      }
    });
  }
  return settings;
}
function ( settings , styles ) { if ( _ . isArray ( styles ) && styles . length > 0 ) { _ . each ( styles , function ( obj ) { if ( ! _ . has ( obj , 'name' ) ) { return ; } var style = _ . findWhere ( settings . styles , { name : obj . name } ) ; if ( ! _ . isUndefined ( style ) ) { style . configure ( obj ) ; } else { settings . styles . push ( toGrawlixStyle ( obj ) ) ; } } ) ; } return settings ; }
Loads an array of style objects into the given GrawlixSettings instance
@param  {GrawlixSettings} settings GrawlixSettings object
@param  {Array}           styles   Array of style objects
@return {GrawlixSettings}
Loads an array of style objects into the given GrawlixSettings instance