mirror of
https://github.com/Azure/cosmos-explorer.git
synced 2026-09-26 21:24:46 +01:00
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:
co-authored by
Victor Meng
Steve Faulkner
parent
8c40df0fa1
commit
2b2de7c645
@@ -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;
|
||||
}
|
||||
Reference in New Issue
Block a user