9 lines
255 B
TypeScript
9 lines
255 B
TypeScript
export function parseQuery(query: string): Record<string, string> {
|
|
const params = new URLSearchParams(query);
|
|
const result: Record<string, string> = {};
|
|
for (const [key, value] of params.entries()) {
|
|
result[key] = value;
|
|
}
|
|
return result;
|
|
}
|