Permalink
Browse files

[keys] support string-argument (make it regexp)

  • Loading branch information...
1 parent c72ce1c commit 4e26c77154e2cf7e4fb2b1171d5b9ac4890a4a80 @guybrush guybrush committed Jun 1, 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 4e26c77

Please sign in to comment.