1 export function getUrlParameter(search: string, name: string) {
2 const safeName = name.replace(/[\[]/, '\\[').replace(/[\]]/, '\\]');
3 const regex = new RegExp('[\\?&]' + safeName + '=([^&#]*)');
4 const results = regex.exec(search);
5 return results === null ? '' : decodeURIComponent(results[1].replace(/\+/g, ' '));