用path记录判断当前是否是前进，true 表示是前进，否则是回退

@param {Object} to 目标 route
@param {Object} from 源 route
@return {boolean} 是否表示返回
163336
function isForwardByArray (to, from) {
  // 根据 fullPath 判断当前页面是否访问过，如果访问过，则属于返回

  let index = HISTORY_STACK.indexOf(to.fullPath)
  if (index !== -1) {
    HISTORY_STACK.length = index + 1
    return false
  }

  return true
}
477829
function compress($from_path,$to_path){
        $from_path=realpath($from_path);
        $to_path=realpath($to_path);
        if(!is_dir($to_path)){
            mkdir($to_path,0777,true);
        }
        if(is_dir($from_path)&&is_dir($to_path)&&is_writable($to_path)){
            return $this->recursion_compress($from_path,$to_path);
        }else{
            return false;
        }
    }
487757
function makePath(to, params, query) {
        var path;
        if (PathUtils.isAbsolute(to)) {
          path = to;
        } else {
          var route = to instanceof Route ? to : Router.namedRoutes[to];

          invariant(route instanceof Route, 'Cannot find a route named "%s"', to);

          path = route.path;
        }

        return PathUtils.withQuery(PathUtils.injectParams(path, params), query);
      }
703253
protected function getRelativePath($from, $to)
    {
        $from = explode('/', str_replace('\\', '/', $from));
        $to = explode('/', str_replace('\\', '/', $to));

        foreach ($from as $depth => $dir) {
            if (isset($to[$depth]) && $dir === $to[$depth]) {
                unset($to[$depth], $from[$depth]);
            }
        }

        for ($i = 0; $i < count($from) - 1; $i++) {
            array_unshift($to, '..');
        }

        return implode('/', $to);
    }
1044503
public function copy($from, $to)
    {
        $pathFrom = $this->pathRoot.ltrim($from, "/");
        $pathTo   = $this->pathRoot.ltrim($to, "/");

        if (is_dir($pathFrom)) {
            return $this->copyDir($pathFrom, $pathTo);
        } else {
            return $this->copyFile($pathFrom, $pathTo);
        }
    }
49654
protected function generateRelativePath($from, $to)
    {
        // some compatibility fixes for Windows paths
        $from = is_dir($from) ? rtrim($from, '\/').'/' : $from;
        $to = is_dir($to)   ? rtrim($to, '\/').'/'   : $to;
        $from = str_replace('\\', '/', $from);
        $to = str_replace('\\', '/', $to);

        $from = explode('/', $from);
        $to = explode('/', $to);
        $from2 = array();
        foreach ($from as $key => $value) {
            if ($value === '..') {
                unset($from2[$key - 1]);
            } else {
                $from2[] = $value;
            }
        }
        $from = $from2;
        $relPath = $to;

        foreach ($from as $depth => $dir) {
            // find first non-matching dir
            if ($dir === $to[$depth]) {
                // ignore this directory
                array_shift($relPath);
            } else {
                // get number of remaining dirs to $from
                $remaining = count($from) - $depth;

                if ($remaining > 1) {
                    // add traversals up to first matching dir
                    $padLength = (count($relPath) + $remaining) * -1;

                    $relPath = array_pad($relPath, $padLength, '..');
                    break;
                } else {
                    $relPath[0] = './'.$relPath[0];
                }
            }
        }

        return implode('/', $relPath);
    }
883780
function(route) {
        return (route != null && self.routes != null && typeof(self.routes[route]) != 'undefined' && self.routes[route] != null)
    }
264084
function (path) {
        if (path[path.length - 1] === '/') {
            path = path.substr(0, path.length - 1);
        }
        return path;
    }
992026
public function move($from, $to)
    {
        return $this->filesystem->move(
            $this->path($from),
            $this->path($to)
        );
    }
1298487
public function copy( $path, $to )
    {
        if ( null === $this->identity )
        {
            return false;
        }

        if ( is_array( $path ) || is_object( $path ) ||
             is_array( $to )   || is_object( $to ) )
        {
            if ( ( ! is_array( $path ) && ! is_object( $path ) ) ||
                 ( ! is_array( $to )   && ! is_object( $to ) ) )
            {
                return false;
            }

            $result = array();

            foreach ( $path as $key => $p )
            {
                foreach ( $to as $toKey => $t )
                {
                    if ( $key == $toKey )
                    {
                        $result[$key] = $this->copy( $p, $t );
                    }
                }
            }

            return $result;
        }

        $to     = $this->validPath( $this->realPath( $to ) );
        $path   = $this->realPath( $path );
        $base   = $this->baseUrl . ( empty( $path ) ? '' : '/' . $path );
        $full   = realpath( $this->baseDir . '/' . $base );
        $isFile = is_file( $full );
        $isDir  = is_dir( $full );

        if ( $isFile )
        {
            $to = $this->secureFile( $to );
        }

        $toBase = $this->baseUrl . '/' . $to;
        $toFull = $this->baseDir . '/' . $toBase;

        if ( ! empty( $to ) && ! is_dir( dirname( $toFull ) ) )
        {
            $ba = '/' . basename( $to );
            $to = $this->createDir( dirname( $to ) );

            if ( ! $to )
            {
                return false;
            }

            $to     = $to . $ba;
            $toBase = $this->baseUrl . '/' . $to;
            $toFull = $this->baseDir . '/' . $toBase;
        }

        if ( ( $isFile || $isDir ) && is_dir( dirname( $toFull ) ) )
        {
            if ( $this->rights( $path )->read &&
                 $this->rights( $to )->write )
            {
                switch ( true )
                {
                    case $isDir:
                        $result = $this->_copy( $full, $toFull );
                        break;

                    case $isFile:
                        $result = @ copy( $full, $toFull );
                        break;
                }

                if ( $result )
                {
                    return $to;
                }
            }
        }

        return false;
    }
1052388
function modulePathToId(path) {
    // We can only transform if there's no plugin used.
    if (path.indexOf('!') === -1) {
        // If it ends with ".js", chop it off.
        var extension = '.js'
        if (path.slice(-extension.length) === '.js') {
            path = path.slice(0, path.length - extension.length);
        }
    }
    return path;
}
709518
function parsePath(path, islineToArc) {
    var coord = this._coord;
    path = GPath.parsePathString(path);
    if (coord.isPolar && islineToArc !== false) {
      path = PathUtil.convertPolarPath(coord, path);
    } else {
      path = PathUtil.convertNormalPath(coord, path);
    }
    return path;
  }
892605
public static String pathTo(@javax.annotation.Nonnull final File from, @javax.annotation.Nonnull final File to) {
    return from.toPath().relativize(to.toPath()).toString().replaceAll("\\\\", "/");
  }
550521
function resolvePathname(to) {
  var from = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';

  var toParts = to && to.split('/') || [];
  var fromParts = from && from.split('/') || [];

  var isToAbs = to && isAbsolute(to);
  var isFromAbs = from && isAbsolute(from);
  var mustEndAbs = isToAbs || isFromAbs;

  if (to && isAbsolute(to)) {
    // to is absolute
    fromParts = toParts;
  } else if (toParts.length) {
    // to is relative, drop the filename
    fromParts.pop();
    fromParts = fromParts.concat(toParts);
  }

  if (!fromParts.length) { return '/'; }

  var hasTrailingSlash = void 0;
  if (fromParts.length) {
    var last = fromParts[fromParts.length - 1];
    hasTrailingSlash = last === '.' || last === '..' || last === '';
  } else {
    hasTrailingSlash = false;
  }

  var up = 0;
  for (var i = fromParts.length; i >= 0; i--) {
    var part = fromParts[i];

    if (part === '.') {
      spliceOne(fromParts, i);
    } else if (part === '..') {
      spliceOne(fromParts, i);
      up++;
    } else if (up) {
      spliceOne(fromParts, i);
      up--;
    }
  }

  if (!mustEndAbs) { for (; up--; up) {
    fromParts.unshift('..');
  } }if (mustEndAbs && fromParts[0] !== '' && (!fromParts[0] || !isAbsolute(fromParts[0]))) { fromParts.unshift(''); }

  var result = fromParts.join('/');

  if (hasTrailingSlash && result.substr(-1) !== '/') { result += '/'; }

  return result;
}
1202699
public static function resolveRelatedPath($from, $to)
    {
        $from_parts = array_filter( explode('/', $from) );
        $to_parts = array_filter( explode('/', $to) );
        foreach($from_parts as $i=>$path) {
            if (in_array($path, $to_parts)) {
                $from_parts[$i] = null;
                $to_parts[$i] = null;
            }
        }
        $from_parts = array_filter($from_parts);
        $to_parts = array_filter($to_parts);
        for($i=0; $i<count($from_parts); $i++) {
            array_unshift($to_parts, '..');
        }
/*
        foreach($from_parts as $path) {
            array_unshift($to_parts, $path);
        }
*/
        return join('/', $to_parts);
    }
1282810
function(path) {
    var p = path || this.path(); 
    var pp = (!p || p == "/")? null : p.substring(0, p.lastIndexOf("/"));
    return (pp=="")? "/" : pp;
  }
715563
function pathToLines(path) {
    var lines = [];
    var curr = null;

    path.forEach(function(cmd) {
        if(cmd[0] == PATH_COMMAND.MOVE) {
            curr = cmd[1];
        }
        if(cmd[0] == PATH_COMMAND.LINE) {
            var pt = cmd[1];
            lines.push(new Line(curr, pt));
            curr = pt;
        }
        if(cmd[0] == PATH_COMMAND.QUADRATIC_CURVE) {
            var pts = [curr, cmd[1], cmd[2]];
            for(var t=0; t<1; t+=0.1) {
                var pt = calcQuadraticAtT(pts,t);
                lines.push(new Line(curr, pt));
                curr = pt;
            }
        }
        if(cmd[0] === PATH_COMMAND.BEZIER_CURVE) {
            var pts = [curr, cmd[1], cmd[2], cmd[3]];
            bezierToLines(pts,10).forEach(pt => {
                lines.push(new Line(curr,pt))
                curr = pt
            })
        }
    });
    return lines;
}