index.js
function RawNode(raw, config, app) {
  utils.define(this, 'isRawNode', true);
  util.run(config, 'rawNode', raw);
  this.files = [];
  var paths = {};

  raw.options = utils.extend({}, config.options, raw.options);
  var opts = resolvePaths(raw.options);
  var filter = filterFiles(opts);

  var srcFiles = utils.arrayify(raw.src);
  if (opts.glob !== false && utils.hasGlob(raw.src)) {
    srcFiles = utils.glob.sync(raw.src, opts);
  }

  srcFiles = srcFiles.filter(filter);

  if (config.options.mapDest) {
    var len = srcFiles.length, i = -1;
    while (++i < len) {
      var node = new FilesNode(srcFiles[i], raw, config);
      app.emit('files', 'filesNode', node);
      app.emit('filesNode', node);
      var dest = node.dest;

      if (!node.src && !node.path) {
        continue;
      }

      var src = resolveArray(node.src, opts);
      if (paths[dest]) {
        paths[dest].src = paths[dest].src.concat(src);
      } else {
        node.src = utils.arrayify(src);
        this.files.push(node);
        paths[dest] = node;
      }
    }

    if (!this.files.length) {
      node = raw;
      raw.src = [];
      this.files.push(raw);
    }

  } else {
    createNode(srcFiles, raw, this.files, config);
  }
}
function RawNode(raw, config, app) {
  utils.define(this, 'isRawNode', true);
  util.run(config, 'rawNode', raw);
  this.files = [];
  var paths = {};

  raw.options = utils.extend({}, config.options, raw.options);
  var opts = resolvePaths(raw.options);
  var filter = filterFiles(opts);

  var srcFiles = utils.arrayify(raw.src);
  if (opts.glob !== false && utils.hasGlob(raw.src)) {
    srcFiles = utils.glob.sync(raw.src, opts);
  }

  srcFiles = srcFiles.filter(filter);

  if (config.options.mapDest) {
    var len = srcFiles.length, i = -1;
    while (++i < len) {
      var node = new FilesNode(srcFiles[i], raw, config);
      app.emit('files', 'filesNode', node);
      app.emit('filesNode', node);
      var dest = node.dest;

      if (!node.src && !node.path) {
        continue;
      }

      var src = resolveArray(node.src, opts);
      if (paths[dest]) {
        paths[dest].src = paths[dest].src.concat(src);
      } else {
        node.src = utils.arrayify(src);
        this.files.push(node);
        paths[dest] = node;
      }
    }

    if (!this.files.length) {
      node = raw;
      raw.src = [];
      this.files.push(raw);
    }

  } else {
    createNode(srcFiles, raw, this.files, config);
  }
}
function RawNode ( raw , config , app ) { utils . define ( this , 'isRawNode' , true ) ; util . run ( config , 'rawNode' , raw ) ; this . files = [ ] ; var paths = { } ; raw . options = utils . extend ( { } , config . options , raw . options ) ; var opts = resolvePaths ( raw . options ) ; var filter = filterFiles ( opts ) ; var srcFiles = utils . arrayify ( raw . src ) ; if ( opts . glob !== false && utils . hasGlob ( raw . src ) ) { srcFiles = utils . glob . sync ( raw . src , opts ) ; } srcFiles = srcFiles . filter ( filter ) ; if ( config . options . mapDest ) { var len = srcFiles . length , i = - 1 ; while ( ++ i < len ) { var node = new FilesNode ( srcFiles [ i ] , raw , config ) ; app . emit ( 'files' , 'filesNode' , node ) ; app . emit ( 'filesNode' , node ) ; var dest = node . dest ; if ( ! node . src && ! node . path ) { continue ; } var src = resolveArray ( node . src , opts ) ; if ( paths [ dest ] ) { paths [ dest ] . src = paths [ dest ] . src . concat ( src ) ; } else { node . src = utils . arrayify ( src ) ; this . files . push ( node ) ; paths [ dest ] = node ; } } if ( ! this . files . length ) { node = raw ; raw . src = [ ] ; this . files . push ( raw ) ; } } else { createNode ( srcFiles , raw , this . files , config ) ; } }
Create a `raw` node. A node represents a single element
in a `files` array, and "raw" means that `src` glob patterns
have not been expanded.

@param {Object} `raw`
@param {Object} `config`
@return {Object}
Create a raw node . A node represents a single element in a files array and raw means that src glob patterns have not been expanded .