adding a Helper Function to create QueryStrings for URLs

This commit is contained in:
chiko committed 2025-10-29 23:47:04 +01:00
1 parent 12e57a97f5
commit 9ec83d8b87
1 file changed
+7
+7
View File
@@ -88,4 +88,11 @@ export function isEuropeanDST( date: Date ) {
// Return true if within DST period
return date >= start && date < end;
}
export function createQS (params: Record<string, string | number | boolean>): string {
const queryString = Object.entries(params)
.map(([key, value]) => `${encodeURIComponent(key)}=${encodeURIComponent(value)}`)
.join("&");
return queryString;
}