Pipe files recursively and then end WriteStream.

@function pipeFileArray
@param {Array} arr
@api public
540553
function pipeFileArray (arr) {
    testPipeFile();

    // Just end WriteStream if no files need to be read to keep default pipe behavior.
    if (arr.length === 0) {
        writable.end();
    } else {
        iterateData.collection = arr;

        iteratePipeFile();
    }
}
346529
function endStream(cb) {
        // If no files were passed in, no files go out ...
        if (!latestFile || (Object.keys(concats).length === 0 && concats.constructor === Object)) {
            cb();
            return;
        }

        // Prepare a method for pushing the stream
        const pushJoinedFile = (joinedBase) => {
            const joinedFile = new File({
                path: joinedBase,
                contents: concats[joinedBase].concat.content,
                stat: concats[joinedBase].stats
            });
            if (concats[joinedBase].concat.sourceMapping) {
                joinedFile.sourceMap = JSON.parse(concats[joinedBase].concat.sourceMap);
            }
            this.push(joinedFile);
            delete concats[joinedBase];
        };

        // Refine the dependency graph
        const refinedDependencyMap = [];
        dependencyGraph.forEach(edge => {
            if ((edge[0] in nameBaseMap) && (edge[1] in nameBaseMap)) {
                refinedDependencyMap.push([nameBaseMap[edge[0]], nameBaseMap[edge[1]]]);
            }
        });
        const sortedDependencies = refinedDependencyMap.length ? toposort(refinedDependencyMap).reverse() : [];
        sortedDependencies.map(pushJoinedFile);

        // Run through all registered contact instances
        for (const targetBase in concats) {
            pushJoinedFile(targetBase);
        }
        cb();
    }
1262618
function next() {
			while ( array.length ) {
				value = array.shift();
				if ( stream.write( value ) === false ) {
					return stream.once( 'drain', next );
				}
			}
			stream.end();
		}
907261
function writeFile(output, filePath, content) {
    var rootFolder = output.getRoot();
    filePath = path.join(rootFolder, filePath);

    return fs.ensureFile(filePath)
    .then(function() {
        return fs.writeFile(filePath, content);
    })
    .thenResolve(output);
}
227338
function (i, res, files, cb) {
        if (!files.length || files.length == 0) {
            cb(false)
        } else {
            if ( fs.existsSync(files[i].target) ) new _(files[i].target).rmSync();

            var sourceStream = fs.createReadStream(files[i].source);
            var destinationStream = fs.createWriteStream(files[i].target);

            sourceStream
                .pipe(destinationStream)
                .on('error', function () {
                    var err = 'Error on SuperController::copyFile(...): Not found ' + files[i].source + ' or ' + files[i].target;
                    cb(err)
                })
                .on('close', function () {

                    try {
                        fs.unlinkSync(files[i].source);
                        files.splice(i, 1);
                    } catch (err) {
                        cb(err)
                    }

                    movefiles(i, res, files, cb)
                })
        }
    }
1234848
function stringify(arr) {
        var f = '';
        for (var i = 0; i < arr.length; i++) {
            f += 'files[' + i + ']=' + querystring.escape(arr[i])
            if (i !== arr.length-1) f += '&';
        }
        return f;
    }
833892
function recurse( out, arr, depth ) {
	var len = arr.length,
		val,
		i;

	for ( i = 0; i < len; i++ ) {
		val = arr[ i ];
		if ( depth && isArray( val ) ) {
			recurse( out, val, depth-1 );
		} else {
			out.push( val );
		}
	}
	return out;
}
244437
function(/**string*/ outDir, /**string*/ fileName, /**string*/ content) {
		fs.writeFileSync(outDir + "/" + fileName, content, IO.encoding);
	}
173068
function pipe(val) {
  var fns = slice.call(arguments, 1)
  return fns.reduce(function (val, fn) {
    return fn(val)
  }, val)
}
1135060
function pipe(file, type, keep) {
  var processors = [];
  var prop = file[type];

  if (type === 'standard' && 'undefined' === typeof prop) {
    processors.push('builtin');
  }

  if (prop) {
    var typeOf = typeof prop;
    if (typeOf === 'string') {
      prop = prop.trim().split(/\s*,\s*/);
    } else if (!Array.isArray(prop)) {
      prop = [prop];
    }

    processors = processors.concat(prop);
  }

  fis.emit('compile:' + type, file);

  if (processors.length) {

    // 过滤掉同名的插件, 没必要重复操作。
    processors = processors.filter(function(item, idx, arr) {
      item = item.__name || item;

      return idx === _.findIndex(arr, function(target) {
        target = target.__name || target;

        return target === item;
      });
    });

    var callback = function(processor, settings, key) {
      settings.filename = file.realpath;
      var content = file.getContent();
      try {
        fis.log.debug('pipe [' + key + '] start');
        var result = processor(content, file, settings);
        fis.log.debug('pipe [' + key + '] end');
        if (keep) {
          file.setContent(content);
        } else if (typeof result === 'undefined') {
          fis.log.warning('invalid content return of pipe [' + key + ']');
        } else {
          file.setContent(result);
        }
      } catch (e) {
        if (typeof e === 'string') {
          e = new Error(e);
        }

        //log error
        fis.log.debug('pipe [' + key + '] fail');
        var msg = key + ': ' + String(e.message || e.msg || e).trim() + ' [' + (e.filename || file.realpath);
        if (e.hasOwnProperty('line')) {
          msg += ':' + e.line;
          if (e.hasOwnProperty('col')) {
            msg += ':' + e.col;
          } else if (e.hasOwnProperty('column')) {
            msg += ':' + e.column;
          }
        }
        msg += ']';
        e.message = msg;
        error(e);
      }
    };

    processors.forEach(function(processor, index) {
      var typeOf = typeof processor,
        key, options;

      if (typeOf === 'object' && processor.__name) {
        options = processor;
        processor = processor.__name;
        typeOf = typeof processor;
      }

      if (typeOf === 'string') {
        key = type + '.' + processor;
        processor = (type === 'standard' && processor === 'builtin') ? builtinStandard : fis.require(type, processor);
      } else {
        key = type + '.' + index;
      }

      if (typeof processor === 'function') {
        var settings = {};
        _.assign(settings, processor.defaultOptions || processor.options || {});
        _.assign(settings, fis.media().get('settings.' + key, {}));
        _.assign(settings, options || {});

        // 删除隐藏配置
        delete settings.__name;
        delete settings.__plugin;
        delete settings.__pos;
        delete settings.__isPlugin;

        callback(processor, settings, key);
      } else {
        fis.log.warning('invalid processor [modules.' + key + ']');
      }
    });
  }
}
354198
function pipeline(arrayOfTasks) {
  return promise.Promise.all(
    slice.call(arguments, 1)
  ).then(function(firstArgs) {
    var value;

    function perform(task) {
      var outcome;
      if (firstArgs) {
        outcome = task.apply(undefined, firstArgs);
        firstArgs = null;
      } else {
        outcome = task(value);
      }

      if (promise.Promise.isInstance(outcome)) {
        return outcome.then(function(outcome) {
          value = outcome;
        });
      } else {
        value = outcome;
      }
    }

    return series.Series.from(arrayOfTasks)
      .each(perform)
      .then(function() { return value; });
  });
}
191305
public static function cleanArray(array &$arr)
    {
        foreach ($arr as $k => $v) {
            if (is_array($v)) {
                self::cleanArray($arr[$k]);
            } else {
                $arr[$k] = stripslashes($v);
            }
        }
    }
1110001
function end (next) {
          filenames(dir, obj).forEach(function (filename) {
            sm.emit('file', filename)
          })
          next()
        }
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;
	    }
125011
function pipe() {
            for (var _len = arguments.length, channels = Array(_len), _key = 0; _key < _len; _key++) {
                channels[_key] = arguments[_key];
            }

            return Channel.pipe.apply(Channel, [this].concat(channels));
        }
240287
async function writeFilesAtomic(files /*: Array<File> */) {
  let removeOnExit = onExit(cleanup);

  try {
    let results = await Promise.all(files.map(async file => {
      let filePath = path.resolve(file.filePath);
      let tempPath = tempy.file();
      let realPath;

      try {
        realPath = await fsRealpath(filePath);
      } catch (err) {
        if (err.code === 'ENOENT') {
          realPath = filePath;
        } else {
          throw err;
        }
      }

      let mode = file.mode;
      let chown = file.chown;

      if (!mode || !chown) {
        try {
          let stats = await fsStat(realPath);
          if (!mode) mode = stats.mode;
          if (!chown && process.getuid) {
            chown = { uid: stats.uid, gid: stats.gid };
          }
        } catch (err) {
          if (err.code !== 'ENOENT') {
            throw err;
          }
        }
      }

      activeTempPaths.add(tempPath);

      let fileContents = file.fileContents;
      let encoding = file.encoding || 'utf8';

      return { tempPath, realPath, fileContents, encoding, mode, chown };
    }));

    await Promise.all(results.map(async file => {
      await fsWriteFile(file.tempPath, file.fileContents, {
        mode: file.mode,
        encoding: file.encoding,
      });

      if (file.chown) {
        await fsChown(file.tempPath, file.chown.uid, file.chown.gid);
      }
    }));

    await Promise.all(results.map(async file => {
      await fsRename(file.tempPath, file.realPath);
      activeTempPaths.delete(file.tempPath);
    }));
  } catch (err) {
    cleanup();
    throw err;
  } finally {
    removeOnExit();
  }
}
205619
function FileInputStream(src){
    // wrap into Promise
    return new Promise(function(resolve, reject){

         // 
        const istream = _fs.createReadStream(src);
        istream.on('error', reject);
        istream.on('open', function(){
            resolve(istream);
        });
    });
}