We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents a04dbc0 + ab24c4d commit c074f41Copy full SHA for c074f41
src/utils.ts
@@ -1,7 +1,8 @@
1
-// https://stackoverflow.com/a/62969380
2
-export function buildQueryString(query: Record<string, any>): string {
+// https://stackoverflow.com/a/62969380 + fix to remove empty entries (.filter(entry => entry))
+export function buildQueryString(query: Record<string, unknown>): string {
3
return Object.entries(query)
4
.map(([key, value]) => (key && value ? `${key}=${value}` : ""))
5
+ .filter((entry) => entry)
6
.join("&");
7
}
8
0 commit comments