填充 Path 数据。
尽量复用而不申明新的数组。大部分图形重绘的指令数据长度都是不变的。
969768
function (cmd) {
        if (!this._saveData) {
            return;
        }

        var data = this.data;
        if (this._len + arguments.length > data.length) {
            // 因为之前的数组已经转换成静态的 Float32Array
            // 所以不够用时需要扩展一个新的动态数组
            this._expandData();
            data = this.data;
        }
        for (var i = 0; i < arguments.length; i++) {
            data[this._len++] = arguments[i];
        }

        this._prevCmd = cmd;
    }
1285163
public static String readTxt(String path)
    {
        if (path == null) return null;
        try
        {
            InputStream in = IOAdapter == null ? new FileInputStream(path) :
                    IOAdapter.open(path);
            byte[] fileContent = new byte[in.available()];
            int read = readBytesFromOtherInputStream(in, fileContent);
            in.close();
            // 处理 UTF-8 BOM
            if (read >= 3 && fileContent[0] == -17 && fileContent[1] == -69 && fileContent[2] == -65)
                return new String(fileContent, 3, fileContent.length - 3, Charset.forName("UTF-8"));
            return new String(fileContent, Charset.forName("UTF-8"));
        }
        catch (FileNotFoundException e)
        {
            logger.warning("找不到" + path + e);
            return null;
        }
        catch (IOException e)
        {
            logger.warning("读取" + path + "发生IO异常" + e);
            return null;
        }
    }
1085813
function handlePathSlashes (path) {
                var cutIndex = 0;
                for (var i = 0; i < path.length - 1; i++) {
                    if (path[i] === DIR_SEPARATOR && path[i + 1] === DIR_SEPARATOR) {
                        cutIndex = i + 1;
                    } else break;
                }

                return path.substr(cutIndex);
            }
546264
function(path) {
            var parts = [];
            qq.each(path.split("/"), function(idx, item) {
                parts.push(qq.s3.util.uriEscape(item));
            });
            return parts.join("/");
        }
1293941
function getPath(tpl, config) {
    const defaultExt = config.extension;
    const tplAbsPath = path.resolve(config.root, tpl);

    if (TPL_MATCH[tplAbsPath]) return TPL_MATCH[tplAbsPath];

    const tplExt = path.extname(tpl);

    // 如果有后缀名，且等于默认后缀名，则直接返回
    if (tplExt && tplExt === `.${defaultExt}`) {
      return TPL_MATCH[tplAbsPath] = tplAbsPath;
    }

    try {
      let stats = fs.statSync(tplAbsPath);
      // 如果当前是一个文件目录，则返回： 文件目录 + index.html
      if (stats.isDirectory()) {
        return TPL_MATCH[tplAbsPath] = path.resolve(tplAbsPath, `index.${defaultExt}`)
      }

      // 否则是一个文件路径，直接返回 tplAbsPath
      return TPL_MATCH[tplAbsPath] = tplAbsPath

    } catch (err) {
      // 进入报错，则说明文件找不到，直接返回自动添加文件名的情况
      return TPL_MATCH[tplAbsPath] = `${tplAbsPath}.${defaultExt}`
    }

  }
325749
public function resolve($path){
        // 如果不指定完整的url, 则认为是访问$urlBase内资源
        if ($this -> isUrlFormat($path)) {
            $url = $path;
        }
        // 忽略重复的路径分隔符
        else if (strpos($path, '/') === 0) {
            $url = $this -> urlBase . substr($path, 1);
        } else {
            $url = $this -> urlBase . $path;
        }
        
        return $url;
    }
923754
def getpath(self, encoding='utf-8', errors='strict'):
        """"""
        path = self.__remove_dot_segments(self.path)
        return uridecode(path, encoding, errors)
734825
public boolean isTemporaryPath(String path) {
    for (String tempPath : tempIdentifiers) {
      String[] tempPathComponents = tempPath.split("/");
      if (tempPathComponents.length > 0
          && path != null && path.contains(tempPathComponents[0].replace("ID", ""))) {
        return true;
      }
    }
    return false;
  }
1030969
def abspath(raw):
    """"""
    path_bits = []
    if raw.find('/') != -1:
        path_bits = raw.split('/')
    elif raw.find('\\') != -1:
        path_bits = raw.split('\\')
    else:
        path_bits = [raw]

    return os.path.abspath(os.sep.join(path_bits))
256164
function processRelativePath(cssPath, importCssPath, importCssText) {
        cssPath = cssPath.split('\\');
        importCssPath = importCssPath.split('/');
        var isSibling = importCssPath.length == 1;
        return importCssText.replace(reg, function(css, before, imgPath, after) {
            if (/^http\S/.test(imgPath) || /^\/\S/.test(imgPath) || isSibling) { //绝对路径or同级跳过
                return css;
            }
            imgPath = imgPath.split('/');
            imgPath = getRelativePath(cssPath, importCssPath, imgPath);
            return before + imgPath + after;
        });
    }
1191377
public static function pathInfo()
    {
        $scriptName = self::getScriptPreg();
        if($scriptName){
            $url = parse_url(preg_replace('/^'.$scriptName.'/', '', $_SERVER['REQUEST_URI'])); // 支持加public和不加public
            return isset($url['path']) ? $url['path'] : '';
        }else
            return '';
    }
651893
function( path ) {
      var normalized = [];
      var parts = path.split( '/' );

      for( var i = 0; i < parts.length; i++ ) {
         if( parts[i] === '.' ) {
            continue;
         }

         if( parts[i] === '..' && normalized.length && normalized[normalized.length - 1] !== '..' ) {
            normalized.pop();
            continue;
         }

         normalized.push( parts[i] );
      }

      return normalized.join( '/' );
   }
1011097
function analyUrl(ctx, path) {
    // 如果是标准的url，则以http或者https开头
    // 则直接发送请求不做处理
    let isUrl = /^(http:\/\/|https:\/\/)/;
    if (isUrl.test(path)) {
      return {
        url: path,
        method: ctx.method
      }
    }

    // 否则，用"?"切分URL："?"前部用以解析真实的URL
    let urlQueryArr = path.split('?');
    let urlPrefix = urlQueryArr[0] || '';

    // url前部只能包含1个或2个":"，否则报错
    let urlReg = urlPrefix.split(':');
    if (urlReg.length < 2 || urlReg.length > 3) {
      throw `Illegal proxy path：${path} !`;
    }

    let [apiName, urlMethod, urlPath] = urlReg;
    let urlOrigin = getOriginApi(api, apiName);

    if (!urlPath) {
      urlPath = urlMethod;
      urlMethod = ctx.method;
    }

    // 拼接URL
    let urlHref = url_opera.resolve(urlOrigin, urlPath)
    return {
      url: path.replace(urlPrefix, urlHref),
      method: urlMethod.toUpperCase()
    }
  }
367037
function formatPath(filePath, root) {
  let dir = root;

  if (!path.isAbsolute(root)) {
    dir = path.join(process.cwd(), root);
  }

  // 修复windows下的\路径问题
  dir = dir.replace(/\\/g, '/');

  return filePath
    .replace(/\\/g, '/')
    .replace(dir, '')
    .split('.')[0];
}
193719
public static function getCanonicalURIPath($path)
    {
        //空路径设置为'/'
        if (empty($path)) {
            return '/';
        } else {
            //所有的uri必须以'/'开头
            if ($path[0] == '/') {
                return AipHttpUtil::urlEncodeExceptSlash($path);
            } else {
                return '/' . AipHttpUtil::urlEncodeExceptSlash($path);
            }
        }
    }
520641
private String buildPath(List<String> path) {
        StringBuilder sb = new StringBuilder();

        for (int i = 0; i < path.size(); i++) {
            if (i > 0) {
                sb.append('.');
            }

            sb.append(path.get(i));
        }

        return sb.toString();
    }
264084
function (path) {
        if (path[path.length - 1] === '/') {
            path = path.substr(0, path.length - 1);
        }
        return path;
    }