Skip to content

Commit

Permalink
Merge pull request #15 from guybrush/keysWithString
Browse files Browse the repository at this point in the history
[keys] support string-argument (make it regexp)
  • Loading branch information
Paolo Fragomeni committed Jun 3, 2012
2 parents c72ce1c + 4e26c77 commit 6430efa
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/eventvat.js
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,10 @@
return Object.keys(this.hash).length;
}

if(typeof regex === 'string') {
regex = new RegExp(regex)
}

for(var k in this.hash) {
if(has(this.hash, k) && regex.test(k)) {
keys.push(k);
Expand Down

0 comments on commit 6430efa

Please sign in to comment.