Skip to content

Commit 2ef4bf8

Browse files
feat(url): Add get search params
1 parent 6a88ae5 commit 2ef4bf8

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

lib/utils/url/getSearchParam.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
export function getSearchParam(param: string, searchParams = new URLSearchParams(document.location.search)) {
2+
return searchParams.get(param)
3+
}
4+
5+
export function getWindowLocationHash() {
6+
return new URLSearchParams(window.location.hash.slice(1))
7+
}

0 commit comments

Comments
 (0)