diff --git a/core/src/utils/config.ts b/core/src/utils/config.ts index 239cacf881..bc0a6789a3 100644 --- a/core/src/utils/config.ts +++ b/core/src/utils/config.ts @@ -24,7 +24,7 @@ export function configFromURL() { .split('&') .map(entry => entry.split('=')) .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]) .forEach(([key, value]) => { config[key] = value; @@ -32,3 +32,7 @@ export function configFromURL() { return config; } + +function startsWith(input: string, search: string): boolean { + return input.substr(0, search.length) === search; +}