Migrated Hosted Explorer to React (#360)

Co-authored-by: Victor Meng <[email protected]>
Co-authored-by: Steve Faulkner <[email protected]>
This commit is contained in:
Steve Faulkner
2021-01-19 16:31:55 -06:00
committed by GitHub
co-authored by Victor Meng Steve Faulkner
parent 8c40df0fa1
commit 2b2de7c645
79 changed files with 2250 additions and 6025 deletions
+14
View File
@@ -0,0 +1,14 @@
export function extractFeatures(params?: URLSearchParams): { [key: string]: string } {
params = params || new URLSearchParams(window.parent.location.search);
const featureParamRegex = /feature.(.*)/i;
const features: { [key: string]: string } = {};
params.forEach((value: string, param: string) => {
if (featureParamRegex.test(param)) {
const matches: string[] = param.match(featureParamRegex);
if (matches.length > 0) {
features[matches[1].toLowerCase()] = value;
}
}
});
return features;
}