code: function (str) {
          // Try fast path regexp
          // See: https://github.com/joyent/node/pull/7878
          var simplePath = typeof str === 'string' && simplePathRegExp.exec(str);
  
          // Construct simple URL
          if (simplePath) {
              var pathname = simplePath[1];
              var search = simplePath[2] || null;
              var url = urlModule.Url !== undefined ? new urlModule.Url() : {};
              url.path = str;
              url.href = str;
              url.pathname = pathname;
              url.search = search;
              url.query = search && search.substr(1);
  
              return url;
          }
  
          return urlModule.parse(str);
      }
docs: via https://github.com/expressjs/parseurl/blob/master/index.js