code: function resolve(relative, base) {
    var path = (base || '/').split('/').slice(0, -1).concat(relative.split('/'))
      , i = path.length
      , last = path[i - 1]
      , unshift = false
      , up = 0;
  
    while (i--) {
      if (path[i] === '.') {
        path.splice(i, 1);
      } else if (path[i] === '..') {
        path.splice(i, 1);
        up++;
      } else if (up) {
        if (i === 0) unshift = true;
        path.splice(i, 1);
        up--;
      }
    }
  
    if (unshift) path.unshift('');
    if (last === '.' || last === '..') path.push('');
  
    return path.join('/');
  }
docs: Resolve a relative URL pathname against a base URL pathname.
  
  @param {String} relative Pathname of the relative URL.
  @param {String} base Pathname of the base URL.
  @return {String} Resolved pathname.
  @private