fix(config): add setupConfig util

This commit is contained in:
Manu Mtz.-Almeida
2018-04-24 01:25:03 +02:00
parent d06409a2bd
commit 0c1476e0ff
6 changed files with 78 additions and 64 deletions

View File

@ -63,16 +63,3 @@ export function needInputShims(win: Window) {
export function testUserAgent(win: Window, expr: RegExp) {
return expr.test(win.navigator.userAgent);
}
export function configFromURL(win: Window) {
const config: any = {};
win.location.search.slice(1)
.split('&')
.filter(entryText => entryText.startsWith('ionic:'))
.map(entryText => entryText.split('='))
.forEach(entry => {
config[entry[0].slice(6)] = decodeURIComponent(entry[1]);
});
return config;
}