UNPKG

574 BJavaScriptView Raw
1import "core-js/modules/es.string.search.js";
2import "core-js/modules/es.regexp.exec.js";
3import global from 'global';
4import { parse } from 'qs';
5var document = global.document;
6export var getQueryParams = function getQueryParams() {
7 // document.location is not defined in react-native
8 if (document && document.location && document.location.search) {
9 return parse(document.location.search, {
10 ignoreQueryPrefix: true
11 });
12 }
13
14 return {};
15};
16export var getQueryParam = function getQueryParam(key) {
17 var params = getQueryParams();
18 return params[key];
19};
\No newline at end of file