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 c002db2 commit b213ad3Copy full SHA for b213ad3
src/getUrlParam.ts
@@ -0,0 +1,10 @@
1
+export function getUrlParam(s?: string): Record<string, string> | undefined {
2
+ s = (s || window.location.search).split('?')[1]
3
+ if (!s) return
4
+ return s.split('&').reduce((pre, cur) => {
5
+ const [key, value] = cur.split('=')
6
+ pre[key] = value
7
+ return pre
8
+ }, {} as Record<string, string>)
9
+
10
+}
0 commit comments