We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 72f8c81 commit 5882410Copy full SHA for 5882410
src/api/common/utils.tsx
@@ -28,15 +28,11 @@ export function getUrlParameters(
28
if (url === null) {
29
return null;
30
}
31
- const regex = /[?&]([^=#]+)=([^&#]*)/g;
32
- const params = {};
33
- let match;
34
- while ((match = regex.exec(url))) {
35
- if (match[1] !== null) {
36
- //@ts-ignore
37
- params[match[1]] = match[2];
38
- }
39
+ const urlObj = new URL(url);
+ const params: { [key: string]: string } = {};
+ urlObj.searchParams.forEach((value, key) => {
+ params[key] = value;
+ });
40
return params;
41
42
0 commit comments