diff --git a/lib/connectors/memory.js b/lib/connectors/memory.js index 9320cf15..5ec7e342 100644 --- a/lib/connectors/memory.js +++ b/lib/connectors/memory.js @@ -562,14 +562,14 @@ function applyFilter(filter) { return false; } - if (example.nin) {
 - for (var i = 0; i < example.nin.length; i++) {
 - if (example.nin[i] == value) {
 - return false;
 - }
 - }
 + if (example.nin) { + for (var i = 0; i < example.nin.length; i++) { + if (example.nin[i] == value) { + return false; + } + } return true; - 
} + } if ('neq' in example) { return compare(example.neq, value) !== 0; @@ -577,7 +577,7 @@ function applyFilter(filter) { if ('between' in example) { return (testInEquality({ gte: example.between[0] }, value) && - testInEquality({ lte: example.between[1] }, value)); + testInEquality({ lte: example.between[1] }, value)); } if (example.like || example.nlike) { diff --git a/test/memory.test.js b/test/memory.test.js index 2c1fc37c..e1c3a73d 100644 --- a/test/memory.test.js +++ b/test/memory.test.js @@ -349,7 +349,7 @@ describe('Memory connector', function() { it('should successfully extract 5 users matching a neq filter over array values', function(done) { User.find({ where: { - 'children': { neq: 'Dhani' }, + children: { neq: 'Dhani' }, }, }, function(err, users) { should.not.exist(err); @@ -358,28 +358,20 @@ describe('Memory connector', function() { }); }); - it('should successfully extract 3 users with inq', function (done) { + it('should successfully extract 3 users with inq', function(done) { User.find({ - where: { - seq: { - inq: [0, 1, 5] - } - } - }, function (err, users) { + where: { seq: { inq: [0, 1, 5] }}, + }, function(err, users) { should.not.exist(err); users.length.should.be.equal(3); done(); }); }); - it('should successfully extract 4 users with nin', function (done) { + it('should successfully extract 4 users with nin', function(done) { User.find({ - where: { - seq: { - nin: [2, 3] - } - } - }, function (err, users) { + where: { seq: { nin: [2, 3] }}, + }, function(err, users) { should.not.exist(err); users.length.should.be.equal(4); done();