Skip to content

Commit

Permalink
Update cache.js
Browse files Browse the repository at this point in the history
  • Loading branch information
zazeblik authored Aug 30, 2018
1 parent 87ab244 commit 6dff8ad
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions cache.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ function Cache() {
let selfCache = this;

this.set = function (key, ttl, result) {
key = key.replace("+","");
//key = key.replace("+","");
if (this.cache && this.cache[key] && this.cache[key]._timeOut)
clearTimeout(this.cache[key]._timeOut);

Expand All @@ -74,7 +74,7 @@ function Cache() {
this.set = this.set.bind(caching.store);

this.get = function(pattern, callback) {
pattern = pattern.replace("+","");
pattern = pattern.replace("+","\\+");
let self = this;
if (~pattern.indexOf('*')) {
pattern = new RegExp(pattern.replace(/\*/g, '.*'), 'g');
Expand Down Expand Up @@ -122,4 +122,4 @@ function Cache() {
this.get = this.get.bind(caching.store);
};

module.exports = Cache;
module.exports = Cache;

0 comments on commit 6dff8ad

Please sign in to comment.