From 5947647ebc51d767023909d4f283be8128ca7511 Mon Sep 17 00:00:00 2001 From: Christopher Jeffrey Date: Wed, 15 Nov 2017 09:08:08 -0800 Subject: [PATCH] config: minor. --- lib/config.js | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/lib/config.js b/lib/config.js index 0e0cfce..e3da0be 100644 --- a/lib/config.js +++ b/lib/config.js @@ -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);