- files: {Array} - intro: {String} - outro: {String}
359055
function concat(options, callback) {
  var files = options.files.map(function(file, i) {
    return {
      path: node_path.join(lib, file + '.js'),
      index: i
    }
  });

  var contents = [];
  async.each(files, function(task, done) {
    fs.readFile(task.path, function(err, content) {
      if (err) {
        return done(err);
      }

      contents[task.index] = content.toString();
      done(null);
    });

  }, function(err) {
    if (err) {
      return callback(err);
    }

    var intro = options.intro ? options.intro + '\n\n\n' : '';
    var outro = options.outro ? '\n\n\n' + options.outro : '';
    var content = intro + contents.join('\n\n') + outro;
    content = content.replace(/@VERSION/g, concat.version());
    callback(null, content);
  });
}
1187171
function Environment() {

    var environment = {};

    var names = [];
    var values = [];

    var t = {};

    t.getNames = getNames;
    t.getValues = getValues;
    t.add = add;
    t.clear = clear;

    return t;

    function getNames() {

        return names;

    }

    function getValues() {

        return values;

    }

    function add(value) {

        // Separates environment into two arrays: names and values to the following initialization of Function object.
        if (value) {

            lodash.assign(environment, value);

            names = lodash.keys(environment);
			// TODO ES-2017 - > values = Object.values(environment);
			values = lodash.keys(environment).map(function(k) { return environment[k]});

        }

    }

    function clear() {

        environment = {};

        names = [];
        values = [];

    }

}
916170
function getFileNames(fileNames = [], componentName) {
  const defaultFileNames = {
    testFileName: `${defaultOptions.testFileName}.${componentName}`,
    componentFileName: componentName,
    styleFileName: componentName,
  }

  const formattedFileNames = Object.keys(fileNames).reduce(
    (acc, curr) => {
      acc[curr] = replaceKeys(fileNames[curr], componentName)
      return acc
    },
    { ...defaultFileNames }
  )

  return formattedFileNames
}
558771
function( err, streams ) {

			// Get base name
			var path = originalFile.path;
			var parts = path.split("."); parts.pop();
			var baseName =  parts.join(".");

	    	// Push each stream to output
	    	for (var i=0; i<streams.length; i++) {
	    		var f = originalFile.clone();
	    		f.contents = streams[i][0]; // Content
	    		f.path = baseName + streams[i][1]; // Suffix
				self.push(f);
	    	}

	    	// We are done
			done();
			return;
	    }
286806
function runner (params, files) {
  var list = array(files || globs())

  list.forEach(function (file) {
    apply(require(path.resolve(file)), [test].concat(params))
  })

  return list
}
365478
function (files) {
  if (files.length === 1) {
    return { file: files[0] };
  } else {
    var contents = files.map(function (fname) {
      return '@import ' + JSON.stringify(fname) + ';';
    }).join('\n');

    return { contents: contents };
  }
}
696579
def files_to_lint(task_args)
      # Note: we're abusing Rake's argument handling a bit here. We call the
      # first argument `files` but it's actually only the first file--we pull
      # the rest out of the `extras` from the task arguments. This is so we
      # can specify an arbitrary list of files separated by commas on the
      # command line or in a custom task definition.
      explicit_files = Array(task_args[:files]) + Array(task_args.extras)

      explicit_files.any? ? explicit_files : files
    end
665583
function(data) {
    var filePath = data.filePath;
    var noExtensionFilePath = data.noExtensionFilePath;
    var fileName = data.fileName;
    var noExtensionFileName = data.noExtensionFileName;

    return [
      "describe('" + noExtensionFilePath + "', function() {",
      "});",
    ].join('\n');
  }
949867
function file_body() {
    $args = func_get_args();
    $files = array_shift($args);

    $module_data = $this->component_data;
    //print_r($module_data);

    $lines = array();
    $lines['name'] = $module_data['readable_name'];
    $lines['type'] = $module_data['base'];
    $lines['description'] = $module_data['short_description'];
    if (!empty($module_data['module_dependencies'])) {
      // For lines which form a set with the same key and array markers,
      // simply make an array.
      foreach ($module_data['module_dependencies'] as $dependency) {
        $lines['dependencies'][] = $dependency;
      }
    }

    if (!empty($module_data['module_package'])) {
      $lines['package'] = $module_data['module_package'];
    }

    $lines['core'] = "8.x";

    if (!empty($this->extraLines)) {
      $lines = array_merge($lines, $this->extraLines);
    }

    $info = $this->process_info_lines($lines);
    return $info;
  }
936134
function FileListBuilder ( parent ) {

    this.files = [];

    this.directory = null;

    this.addFile = function ( file ) {
        this.files.push( file );
        return this;
    };

    // Adds a directory of files 
    this.push = function ( directory ) {
        var child = new FileListBuilder( this );
        this.files = this.files.concat( [ directory+'_.header.js', directory+'*.js' ] );
        child.directory = directory;
        return child;
    };

    this.pop = function () {
        if ( this.directory ) {
            this.files = this.files.concat( ['!'+this.directory+'_.footer.js', this.directory+'_.footer.js' ]  );
        }
        if ( parent ) {
            parent.files = parent.files.concat( this.files );
        }
        return parent;
    };

    this.get = function () {
        return this.files;
    };
}
286736
function(files, next) {
        var fromFile = files[0],
          toFile = files[1];

        differ(id, fromFile, toFile, next);
      }
647239
function strings() {
		extend(String.prototype, {
			trim: function() {
				return this.replace(/^\s*/, "").replace(/\s*$/, "");
			},
			repeat: function(n) {
				return new Array(n + 1).join(this);
			},
			startsWith: function(sub) {
				return this.indexOf(sub) === 0;
			},
			endsWith: function(sub) {
				sub = String(sub);
				var i = this.lastIndexOf(sub);
				return i >= 0 && i === this.length - sub.length;
			},
			contains: function(sub) {
				return this.indexOf(sub) > -1;
			},
			toArray: function() {
				return this.split("");
			}
		});
	}
251675
function extractFiles(args) {
  var usage = '\n' +
    cyan('USAGE:') + '   hulk [--wrapper wrapper] [--outputdir outputdir] ' +
    '[--namespace namespace] [--variable variable] FILES\n\n' +
    cyan('OPTIONS:') + ' [-w, --wrapper]   :: wraps the template (i.e. amd)\n' +
    '         [-o,  --outputdir] :: outputs the templates as individual files to a directory\n\n' +
    '         [-n,  --namespace] :: prepend string to template names\n\n' +
    '         [-vn, --variable]  :: variable name for non-amd wrapper\n\n' +
    cyan('EXAMPLE:') + ' hulk --wrapper amd ./templates/*.mustache\n\n' +
    cyan('NOTE:') + '    hulk supports the "*" wildcard and allows you to target specific extensions too\n';
  var files = [];

  if (options.version) {
    console.log(require('../package.json').version);
    process.exit(0);
  }

  if (!args.length || options.help) {
    console.log(usage);
    process.exit(0);
  }

  args.forEach(function(arg) {
    if (/\*/.test(arg)) {
      arg = arg.split('*');
      files = files.concat(
        fs.readdirSync(arg[0] || '.')
          .map(function(f) {
            var file = path.join(arg[0], f);
            return new RegExp(esc(arg[1]) + '$').test(f) && fs.statSync(file).isFile() && file;
          })
          .filter(function(f) {
            return f;
          })
      );
      return files;
    }

    if (fs.statSync(arg).isFile()) files.push(arg);
  });

  return files;
}
1354851
function transformFile(contents) {
        var $ = cheerio.load(contents.toString());
        var result = [];
        $(options.selector).each(function() {
            var element = $(this);
            var fileName = options.getFileName(element);
            result.push(fileName);
        });

        return result;
    }
23269
function(sounds) {
          //console.log("SOUNDS", typeof sounds, sounds )
          sounds = JSON.parse( sounds )
          filename = sounds.results[0].name
          var id = sounds.results[0].id

          if (typeof Freesound.loaded[filename] === 'undefined') {

            freesound.getSound( id, function( val ){ 
              var request = new XMLHttpRequest(),
                  dict    = JSON.parse( val ),
                  path    = dict.previews['preview-hq-mp3']

              //Gibber.log("now downloading " + filename + ", " + sounds.sounds[0].duration + " seconds in length")
              request.open('GET', path, true) //"?&api_key=" + freesound.apiKey, true);
              request.responseType = 'arraybuffer';
              //request.withCredentials = true;
              request.onload = function( v ) {
                onload(request)
              };
              request.send();

              console.log( 'freesound path:', path, request )
            }, null )
          } else {
            sampler.buffer = Freesound.loaded[filename];
            sampler.filename = filename;
            sampler.bufferLength = sampler.buffer.length;
            sampler.isLoaded = true;
            sampler.end = sampler.bufferLength;
            sampler.setBuffer(sampler.buffer);
            sampler.setPhase(sampler.bufferLength);

            sampler.send(Master, 1)
            if (callback) {
              callback()
            }
          }
        }
260362
function readAndHashFiles(files) {
    const fileHashes = {};
    const fileContents = {};
    const promises = [];

    function readSingleFile(file) {
        return new Promise((resolve, reject) => {
            fs.readFile(file, (err, data) => {
                if (err) {
                    console.log(err);
                    reject(err);
                    return;
                }
                const hash = crypto.createHash('sha1');
                hash.update(data);
                const bufferHash = hash.digest();
                fileHashes[file] = bufferHash.toString('hex');
                if (file.endsWith('.js') && !file.endsWith('.test.js')) {
                    fileContents[file] = data.toString('utf8');
                }
                resolve();
            });
        });
    }

    files.forEach((file) => {
        promises.push(readSingleFile(file));
    });

    return new Promise((resolve, reject) => {
        Promise.all(promises)
            .then(() => {
                resolve({ files, fileContents, fileHashes });
            })
            .catch(reject);
    });
}
665269
function getComponentMapping( name, files ) {
		grunt.verbose.writeln( 'BowerMap::getComponentMapping - ' + name );


		//first get list of all files
		var fileList = [];
		if ( shim[ name ] !== undefined ) {
			grunt.verbose.writeln( '    using shim value' );
			//use shim value
			fileList = fileList.concat( shim[ name ] );
		}
		else {
			grunt.verbose.writeln( '    using result value - ' + files );
			//make sure files is an array
			if (typeof files === 'string'){
				files = [files];
			}
			//we just need the path relative to the module directory
			files.forEach( function( file ){
				file = path.fix( file );
				fileList.push( file.replace( path.fix( path.join( bowerPath, name ) ) , "" ) );
			});
		}

		//expand list
		var expandedList = [];
		fileList.forEach( function( file ){
			grunt.verbose.writeln( '      globbing - ' + path.join( name, file ) );
			glob.sync( path.join( name, file ), { cwd: bowerPath, dot: true } ).forEach( function( filename ) {
				var src = path.fix( path.join( bowerPath, filename ) );
				grunt.verbose.writeln( 'src      ' + src );
				expandedList.push( src );
			});
		});

		//filter filetypes
		expandedList = expandedList.filter( function( file ){
			var ext = path.extname( file ).substr(1);
			if ( extensions ){
				return extensions.indexOf( ext ) >= 0;
			}
			else{
				return true;
			}
		});


		//get common path for building destination
		var commonPath = maintainCommonPaths ? "" : getCommonPathBase( expandedList );
		grunt.verbose.writeln( '   common path: ' + commonPath );


		//build default mapping
		var componentMap = {};
		grunt.verbose.writeln( '   mapping files:' );
		expandedList.forEach( function( file ){

			if ( expandedMap[ file ] !== undefined ) {
				//use user configured mapping if set
				componentMap[ file ] = expandedMap[ file ];
				grunt.log.writeln( '  * '+file+' -> '+ expandedMap[ file ] );
			}
			else {
				var newFilename = commonPath === "" ? file : file.replace( commonPath, "" );
				//console.log('      newfileName:',newFilename);
				var dest = path.join( destPath, newFilename );
				//console.log('      dest:',dest);

				if ( useNamespace === true || ( useNamespace === undefined && expandedList.length > 1 ) ){
					dest = dest.replace( destPath, path.join( destPath, name ) );
				}
				componentMap[ file ] = dest;
				grunt.log.writeln( '    '+file+' -> '+ dest );

			}

		});

		return componentMap;

	}