Permalink
Browse files

Merge pull request #15 from guybrush/keysWithString

[keys] support string-argument (make it regexp)
  • Loading branch information...
2 parents c72ce1c + 4e26c77 commit 6430efa964624ae81c05a638e0ed17435cdb7c80 Paolo Fragomeni committed Jun 3, 2012
Showing with 4 additions and 0 deletions.
  1. +4 −0 lib/eventvat.js
View
@@ -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);

0 comments on commit 6430efa

Please sign in to comment.