Skip to content

Commit

Permalink
fix(config): avoid using startWith for IE support
Browse files Browse the repository at this point in the history
fixes #14922
  • Loading branch information
manucorporat committed Jul 29, 2018
1 parent 25423a0 commit 73a9f14
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion core/src/utils/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,15 @@ 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;
});

return config;
}

function startsWith(input: string, search: string): boolean {
return input.substr(0, search.length) === search;
}

0 comments on commit 73a9f14

Please sign in to comment.