adding a Helper Function to create QueryStrings for URLs

This commit is contained in:
2025-10-29 23:47:04 +01:00
parent 12e57a97f5
commit 9ec83d8b87

View File

@@ -89,3 +89,10 @@ export function isEuropeanDST( date: Date ) {
// Return true if within DST period // Return true if within DST period
return date >= start && date < end; 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;
}