function parseQueryString(query) {
  const params = new Map();
  for (const [key, value] of new URLSearchParams(query)) {
    params.set(key.toLowerCase(), value);
  }
  return params;
}
Helper function to parse query string (e.g. ?param1=value&param2=...).
@param {string} query
@returns {Map}