function encodeQueryData(data) {
  const queryString = [];
  for (let d in data) queryString.push(d + "=" + encodeURIComponent(data[d]));
  return queryString.join("&");
}
Encodes the provided data into a URL query string format.

@param {Record<string, any>} data - The data to be encoded.
@returns {string} The encoded query string.