mirror of
https://github.com/hanzoai/calendar.git
synced 2026-09-24 22:42:24 +00:00
15 lines
324 B
TypeScript
15 lines
324 B
TypeScript
const getQueryParam = (paramName: string) => {
|
|
if (typeof window !== "undefined") {
|
|
const currentUrl = new URL(window.location.href);
|
|
const searchParams = currentUrl.searchParams;
|
|
|
|
const parameter = searchParams.get(paramName);
|
|
|
|
return parameter;
|
|
}
|
|
|
|
return undefined;
|
|
};
|
|
|
|
export default getQueryParam;
|