'use strict';

/*!
 * @techmely/utils
 * Copyright(c) 2021-2024 Techmely <techmely.creation@gmail.com>
 * MIT Licensed
 */


// src/stringifyQueryObject/index.ts
function stringifyQueryObject(queryParameters) {
  if (!queryParameters)
    return "";
  return Object.entries(queryParameters).reduce((queryString, [key, val]) => {
    const symbol = queryString.length === 0 ? "?" : "&";
    queryString += typeof val === "string" ? `${symbol}${key}=${val}` : "";
    return queryString;
  }, "");
}

exports.stringifyQueryObject = stringifyQueryObject;
