tasks/fileblocks.js
function(data, options) {
    var configs = [];

    if (_.isArray(data)) {
      data.forEach(function(block) {
        configs.push(new BlockConfig(block.name, block, options));
      });
    } else if (_.isPlainObject(data)) {
      _.forOwn(data, function(value, name) {
        configs.push(new BlockConfig(name, value, options));
      });
    } else {
      grunt.warn('Block configuration must be an array or object.');
    }

    return configs;
  }
function(data, options) {
    var configs = [];

    if (_.isArray(data)) {
      data.forEach(function(block) {
        configs.push(new BlockConfig(block.name, block, options));
      });
    } else if (_.isPlainObject(data)) {
      _.forOwn(data, function(value, name) {
        configs.push(new BlockConfig(name, value, options));
      });
    } else {
      grunt.warn('Block configuration must be an array or object.');
    }

    return configs;
  }
function ( data , options ) { var configs = [ ] ; if ( _ . isArray ( data ) ) { data . forEach ( function ( block ) { configs . push ( new BlockConfig ( block . name , block , options ) ) ; } ) ; } else if ( _ . isPlainObject ( data ) ) { _ . forOwn ( data , function ( value , name ) { configs . push ( new BlockConfig ( name , value , options ) ) ; } ) ; } else { grunt . warn ( 'Block configuration must be an array or object.' ) ; } return configs ; }
Normalize and return block configurations from the Gruntfile.
@param {Object[]|Object.<string, object>} blocks - The block configurations from the Gruntfile.
@returns {BlockConfig[]}
Normalize and return block configurations from the Gruntfile .