Skip to content
Snippets Groups Projects
Commit 42572790 authored by Alexander Rose's avatar Alexander Rose
Browse files

added urlQueryParameter helper function

parent 75c3cc1f
No related branches found
No related tags found
No related merge requests found
/**
* Copyright (c) 2018 mol* contributors, licensed under MIT, See LICENSE file for more info.
*
* @author Alexander Rose <alexander.rose@weirdbyte.de>
*/
export function urlQueryParameter (id: string) {
if (typeof window === 'undefined') return undefined
const a = new RegExp(`${id}=([^&#=]*)`)
const m = a.exec(window.location.search)
return m ? decodeURIComponent(m[1]) : undefined
}
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment