fix(config): avoid using startWith for IE support

fixes #14922
This commit is contained in:
Manu Mtz.-Almeida
2018-07-29 13:27:00 +02:00
parent 25423a06f2
commit 73a9f140ed

View File

@ -24,7 +24,7 @@ export function configFromURL() {
.split('&') .split('&')
.map(entry => entry.split('=')) .map(entry => entry.split('='))
.map(([key, value]) => [decodeURIComponent(key), decodeURIComponent(value)]) .map(([key, value]) => [decodeURIComponent(key), decodeURIComponent(value)])
.filter(([key]) => key.startsWith(IONIC_PREFIX)) .filter(([key]) => startsWith(key, IONIC_PREFIX))
.map(([key, value]) => [key.slice(IONIC_PREFIX.length), value]) .map(([key, value]) => [key.slice(IONIC_PREFIX.length), value])
.forEach(([key, value]) => { .forEach(([key, value]) => {
config[key] = value; config[key] = value;
@ -32,3 +32,7 @@ export function configFromURL() {
return config; return config;
} }
function startsWith(input: string, search: string): boolean {
return input.substr(0, search.length) === search;
}