This commit is contained in:
Cade Scroggins 2019-03-07 23:48:07 -08:00
parent 478149c28c
commit 9929880f6b
No known key found for this signature in database
GPG key ID: 519697F4ACAF4893

View file

@ -1043,17 +1043,14 @@
this._pathDelimiter = options.pathDelimiter;
this._protocolRegex = /^[a-zA-Z]+:\/\//i;
this._urlRegex = /^((https?:\/\/)?[\w-]+(\.[\w-]+)+\.?(:\d+)?(\/\S*)?)$/i;
this._cachedQuery = '';
this._cachedRes = null;
this.parse = this.parse.bind(this);
this._lastQuery = "";
this._lastParse;
}
parse(query) {
if (this._lastQuery === query) {
return this._lastParse;
}
this._lastQuery = query;
if (this._cachedQuery === query) return this._cachedRes;
this._cachedQuery = query;
const res = { query: query, split: null };
if (this._urlRegex.test(query)) {
@ -1097,7 +1094,7 @@
}
res.color = QueryParser._getColorFromUrl(this._commands, res.redirect);
this._lastParse = res;
this._cachedRes = res;
return res;
}