adding a Helper Function to create QueryStrings for URLs
This commit is contained in:
@@ -88,4 +88,11 @@ 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;
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user