code: function normalizeArray(parts, allowAboveRoot) {
      var res = [];
  
      for (var i = 0; i < parts.length; i += 1) {
        var p = parts[i];
        if (!p || p === '.') continue;
        if (p === '..') {
          if (res.length && res[res.length - 1] !== '..') {
            res.pop();
          } else if (allowAboveRoot) {
            res.push('..');
          }
        } else if (/^http(s)?:/.test(p)) {
          res.push(p + '/');
        } else {
          res.push(p);
        }
      }
      return res;
    }
docs: normalize array
  @param {Array} parts
  @param {Boolean} allow above root
  @return {Array}