code: function parseUrlSearch(search) {
    if (search[0] === '?') search = search.slice(1);
  
    function splitParam(param) {
      var [key, value = ''] = param.split('=');
      return [key, decodeURIComponent(value)];
    }
  
    return objectFromPairs(search . split('&') . map(splitParam));
  }
docs: URL-RELATED UTILITIES --------------------- Parse a search string into an object.