code: function resolve(from, to) {
    var objFrom = parse(from);
    var objTo = parse(to);
  
    if (objFrom.kind === 'url' && objTo.kind === 'url') {
      return format(parse(url.resolve(from, to)));
    }
  
    if (objFrom.kind === 'urn') {
      // In our world all URNs are absolute (if they weren’t they’d be
      // seen as a non-absolute URL).
  
      if (objTo.kind === 'urn') {
        return format(objTo);
      }
  
      // "from" is a urn and "to" is a url
      if (objTo.kind === 'url' && objTo.absolute) {
        return format(objTo);
      } else {
        if (objFrom.pathname) {
          objFrom.pathname = url.resolve(objFrom.pathname, objTo.baseUri);
        }
        objFrom.baseUri = objFrom.host + (objFrom.pathname || '');
        objFrom.fragment = objTo.fragment;
        return format(objFrom);
      }
    } else {
      // "from" is a url and "to" is a urn (!)
      return format(objTo);
    }
  }
docs: ****************************************************************** resolve a relative URI ******************************************************************