@emeryld/rrroutes-client 2.3.12 → 2.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -104,23 +104,16 @@ function toSearchString(query) {
104
104
  if (!query) return "";
105
105
  const params = new URLSearchParams();
106
106
  for (const [k, v] of Object.entries(query)) {
107
- if (v == null) continue;
108
- if (Array.isArray(v)) {
109
- v.forEach((x) => {
110
- if (x == null) return;
111
- if (typeof x === "object") {
112
- params.append(k, JSON.stringify(x));
113
- } else {
114
- params.append(k, String(x));
115
- }
116
- });
107
+ if (v === void 0 || v === null) continue;
108
+ if (typeof v === "string") {
109
+ params.append(k, v);
117
110
  continue;
118
111
  }
119
- if (typeof v === "object") {
120
- params.set(k, JSON.stringify(v));
112
+ if (typeof v === "number" || typeof v === "boolean") {
113
+ params.append(k, String(v));
121
114
  continue;
122
115
  }
123
- params.set(k, String(v));
116
+ params.append(k, JSON.stringify(v));
124
117
  }
125
118
  const s = params.toString();
126
119
  return s ? `?${s}` : "";