Skip to content

Commit d5de96b

Browse files
committed
Check for RegExp in namespace code.
1 parent 0194e37 commit d5de96b

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

index.js

+7-2
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,12 @@ methods.forEach(function(method){
5353
, self = this;
5454

5555
this.namespace(path, function(){
56-
path = this._ns.join('/').replace(/\/\//g, '/').replace(/\/$/, '') || '/';
56+
if (Object.prototype.toString.call(path) == '[object RegExp]') {
57+
path = path; // TODO: Convert RegExp
58+
}
59+
else {
60+
path = this._ns.join('/').replace(/\/\//g, '/').replace(/\/$/, '') || '/';
61+
}
5762
args.forEach(function(fn){
5863
orig.call(self, path, fn);
5964
});
@@ -62,4 +67,4 @@ methods.forEach(function(method){
6267
return this;
6368
};
6469
});
65-
});
70+
});

0 commit comments

Comments
 (0)