Process destination file(s).

@param {string|Array} destination - destination file or an array of
destination files
@returns {Array} an array of resolved destination file paths
197630
function processDestination(destination) {
    var destinations = [];

    if (_.isArray(destination)) {
      destinations = destination;
    }
    if (_.isString(destination)) {
      destinations.push(destination);
    }
    if (!destinations.length) {
      throw new Error('Destination file not defined.');
    }
    return destinations.map(util.resolveEnsureFile);
  }
84366
private function getDestination($destination) {
		$destination = $destination instanceof Path ? $destination : new Path($destination);
		$targetDir = new Directory($destination->getDirname());
		$targetDir->make();
		return $destination;
	}
343675
function processor() {
    var destination = unified()
    var length = attachers.length
    var index = -1

    while (++index < length) {
      destination.use.apply(null, attachers[index])
    }

    destination.data(extend(true, {}, namespace))

    return destination
  }
1046061
function (targetFilePath) {
    var splitPaths = targetFilePath.split('/');
    var targetFilename = splitPaths.pop();
    var targetPath = splitPaths.join('/');
    targetPath = targetPath + '/';
    return [targetPath, targetFilename];
  }
320754
function(destination, source, name_list) {
		for (var i = 0, count = name_list.length; i < count; i++) {
			var name = name_list[i];
			if (name in source) destination[name] = source[name];
		}
	}
101421
function copyFiles(g, defaultOutputDir, targetDir) {
            var files = glob.sync(g.src.toString(), {cwd: g.cwd, root: '/'});
            files.forEach(function (file) {
                var destinationDirectory = defaultOutputDir + path.sep + targetDir;
                var fileDirectory = path.dirname(file);
                if (fileDirectory !== '.') {
                    destinationDirectory = destinationDirectory + path.sep + fileDirectory;
                }
                fs.mkdirpSync(destinationDirectory);
                var source = path.resolve(g.cwd, file);
                var extension = path.extname(file);
                var destination;
                if (targetDir === 'test') {
                    var base = path.basename(file, extension);
                    if (extension === '.js') {
                        destination = destinationDirectory + path.sep + path.basename(base.replace(/\./g, '_') + extension);
                    } else if (extension === '.feature') {
                        destination = destinationDirectory + path.sep + path.basename(base.concat(extension).replace(/\./g, '_') + '.js');
                    }
                } else {
                    destination = destinationDirectory + path.sep + path.basename(file);
                }

                fs.copySync(source, destination, {replace: true});
            });
        }
509911
function(next) {
          if(
            readOnly  ||
            !statDest ||
            (statSrc.isFile() && statDest.isFile()) ||
            (statSrc.isDirectory() && statDest.isDirectory())
          ) {
            return next();
          } else {
            grunt.verbose.writeln('  Remove destination %s:'+' Source and destination are not of the same type.'.grey, dest.blue);
            // else remove destination first:
            dirExists[dest] = false;
            rimraf(dest, next);
          }
        }
519866
def find_html_files(self, destination):
        
        for root, dirs, files in os.walk(destination):
            for f in files:
                if f.endswith('.html'):
                    yield os.path.join(root, f)
990449
function outputPath(options, source) {
    var DEBUG = false;
    if (DEBUG)
        console.log('sourceFolder: ' + options.sourceFolder);
    var globBase = options.sourceFolder.replace(/\*.*/, '');
    if (globBase.endsWith('.sol')) // single file
        globBase = path.join(globBase, '../');
    if (DEBUG)
        console.log('globBase: ' + globBase);
    var optDestination = options.destinationFolder ? options.destinationFolder : globBase;
    if (DEBUG)
        console.log('optDestination: ' + optDestination);
    var destinationFolder = path.join(globBase, optDestination);
    if (optDestination === globBase)
        destinationFolder = globBase;
    if (DEBUG)
        console.log('destinationFolder: ' + destinationFolder);
    // destination-folder is absolut
    if (options.destinationFolder && options.destinationFolder.startsWith('/'))
        destinationFolder = path.join(options.destinationFolder, './');
    var fileNameRelative = source.filename.replace(globBase, '');
    if (DEBUG)
        console.log('fileNameRelative: ' + fileNameRelative);
    var goalPath = path.join(destinationFolder, fileNameRelative);
    return goalPath;
}
957502
function(next) {
          // Here destination is allways a file.
          // Only the parent folder is required
          var dir = dirname(dest);
          if(dirExists[dir]) {
            return next();
          }

          grunt.verbose.writeln('  Make directory %s', dir.blue);
          mkdirp(dir, function(err) {
            if(err) {
              return next(err);
            }
            tally.dirs++;
            dirExists[dir] = true;
            return next();
          });

        }
1271769
function merge(destination, source, preserve) {
        preserve = preserve || [];

        for (var property in source) {
          if (preserve.indexOf(property) === -1) {
            destination[property] = source[property];
          }
        }

        return destination;
      }
655187
function resolveDir(directories)
{
  var directoriesAbsPath;

  if (typeOf(directories) == 'array')
  {
    directoriesAbsPath = directories.map(function(d)
    {
      return path.resolve(d);
    }).join('|');
  }
  else
  {
    directoriesAbsPath = path.resolve(directories);
  }

  return directoriesAbsPath;
}
37475
function (data) {
            var that = this,
                options = $.extend({}, this.options, data);
            if (options.processQueue && options.processQueue.length) {
                this._transformProcessQueue(options);
                if (this._processing === 0) {
                    this._trigger('processstart');
                }
                $.each(data.files, function (index) {
                    var opts = index ? $.extend({}, options) : options,
                        func = function () {
                            return that._processFile(opts);
                        };
                    opts.index = index;
                    that._processing += 1;
                    that._processingQueue = that._processingQueue.pipe(func, func)
                        .always(function () {
                            that._processing -= 1;
                            if (that._processing === 0) {
                                that._trigger('processstop');
                            }
                        });
                });
            }
            return this._processingQueue;
        }
944630
function(next) {
          if(!statDest || !lazy || readOnly) {
            return next();
          }
          if(statDest.mtime.getTime() >= statSrc.mtime.getTime()) {
            tally.useCached++;
            grunt.verbose.writeln('  Ignore %s:'+' Destination file is allready transformed (See options.lazy).'.grey, src.blue);
            // Leave proceed
            return done(null, false);
          } else {
            next();
          }
        }
161330
function (files) {
  return files.reduce(function (filesMap, file) {
    let fileName = path.parse(file).name;
    filesMap[fileName] = readFile(file, 'utf8');

    return filesMap;
  }, {});
}
368749
function processFile(idx, count, filename, data, parsedDeclarations, pluggable) {
  const declarations = parsedDeclarations.files[filename];
  // Inject dependent declaration extraction to last file
  const dependentDeclarations = idx === count - 1 ? parsedDeclarations.dependentDeclarations : [];
  const variables = { global: {} };

  const globalDeclarationResultHandler = (declaration, value, sassValue) => {
    if(!variables.global[declaration.declaration]) {
      variables.global[declaration.declaration] = [];
    }
    const variableValue = pluggable.run(Pluggable.POST_VALUE, { value, sassValue }).value;
    variables.global[declaration.declaration].push({ declaration, value: variableValue });
  }

  const fileId = getFileId(filename);
  const injection = injectExtractionFunctions(fileId, declarations, dependentDeclarations, { globalDeclarationResultHandler });
  const injectedData = `${data}\n\n${injection.injectedData}`;
  const injectedFunctions = injection.injectedFunctions;

  return {
    fileId,
    declarations,
    variables,
    injectedData,
    injectedFunctions,
  };
}
1146606
public function findDestination($destination)
	{
		if (is_file($destination))
		{
			return $destination;
		}

		if ($location = $this->finder->findFileReversed($destination))
		{
			return $location;
		}

		$paths = $this->finder->getPaths();

		if (empty($paths))
		{
			return false;
		}

		$last = end($paths);

		return $last.ltrim($destination, DIRECTORY_SEPARATOR);
	}