code: function parse(uri) {
    var result = { baseUri: '', fragment: '#' };
  
    if (uri.slice(0, 4).toLowerCase() === 'urn:') {
      result.kind = 'urn';
      var parts = uri.match(URN_REGEX);
      if (parts) {
          result.baseUri = parts[1] + (parts[2] || '');
        result.host = parts[1];
        if (parts[2]) { result.pathname = parts[2]; }
        if (parts[3]) { result.fragment = parts[3]; }
      }
    } else {
      result.kind = 'url';
      var parsed = url.parse(uri);
      if (parsed.hash) {
        result.fragment = parsed.hash;
        delete parsed.hash;
      }
      result.absolute =
        (parsed.host && parsed.pathname && parsed.pathname[0] === '/') ?
        true : false;
      result.baseUri = url.format(parsed);
    }
  
    return result;
  }
docs: ****************************************************************** Parse a URI. Returns an object that can be passed to format(). ******************************************************************