Skip to content

Commit

Permalink
Merge pull request #7 from plaidev/hotfix/0.3.4
Browse files Browse the repository at this point in the history
Fix
  • Loading branch information
makinoy authored Jul 18, 2017
2 parents 83559fa + 20161e9 commit 5952bca
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/filtr.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ _eq = function (a, b) {
if (a instanceof Array) {
return a.some(function(v) {return _eq(v, b)})
}
if (b instanceof RegExp) {
if (a != null && b instanceof RegExp) {
return b.test(a);
}
if (b === null) {
Expand Down
6 changes: 6 additions & 0 deletions test/query.js
Original file line number Diff line number Diff line change
Expand Up @@ -330,6 +330,12 @@ describe('Query', function () {
Q.test({sets: ['Firefox', 'abc']}, {type: 'single'}).should.be.false;
});

it('should regexp $eq work appropriately', function () {
var query = {'test': /f/}
, Q = filtr(query);
Q.stack.should.have.length(1);
Q.test({}, {type: 'single'}).should.be.false;
});

});

Expand Down

0 comments on commit 5952bca

Please sign in to comment.