config: minor.

This commit is contained in:
Christopher Jeffrey 2017-11-15 09:08:08 -08:00
parent 459803aaec
commit 5947647ebc
No known key found for this signature in database
GPG Key ID: 8962AB9DE6666BBD
1 changed files with 5 additions and 8 deletions

View File

@ -986,7 +986,7 @@ class Config {
return {};
}
return this.parseForm(query, this.query);
return this.parseForm(query, '?', this.query);
}
/**
@ -1006,26 +1006,23 @@ class Config {
return {};
}
return this.parseForm(hash, this.hash);
return this.parseForm(hash, '#', this.hash);
}
/**
* Parse form-urlencoded variables.
* @private
* @param {String} query
* @param {String} ch
* @param {Object} map
*/
parseForm(query, map) {
parseForm(query, ch, map) {
assert(typeof query === 'string');
if (query.length === 0)
return;
let ch = '?';
if (map === this.hash)
ch = '#';
if (query[0] === ch)
query = query.substring(1);