mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-20 12:29:55 +08:00
@ -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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user