Skip to content

Commit

Permalink
Merge pull request OptimalBits#154 from eightyfive/master
Browse files Browse the repository at this point in the history
Fixed broken RegExp implementation
  • Loading branch information
manast committed Nov 8, 2015
2 parents 7fb80d1 + db2a200 commit 7b18da7
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions lib/memory-backend.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,14 @@ MemoryBackend.prototype = {
.end();

var match;
for(var b in this._buckets){
var regex = new RegExp("^"+b+"$");
if(bucket.match(regex)) bucket = b;
var re;
if (!this._buckets[bucket]) {
Object.keys(this._buckets).some(function(b) {
re = new RegExp("^"+b+"$");
match = re.test(bucket);
if (match) bucket = b;
return match;
});
}

if(this._buckets[bucket]){
Expand Down

0 comments on commit 7b18da7

Please sign in to comment.