Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
Cade Scroggins committed Mar 8, 2019
1 parent 478149c commit 9929880
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -1043,17 +1043,14 @@ <h2 class="category-name">${category}</h2>
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)) {
Expand Down Expand Up @@ -1097,7 +1094,7 @@ <h2 class="category-name">${category}</h2>
}

res.color = QueryParser._getColorFromUrl(this._commands, res.redirect);
this._lastParse = res;
this._cachedRes = res;
return res;
}

Expand Down

0 comments on commit 9929880

Please sign in to comment.