mongodb-query-parser
Advanced tools
Comparing version
@@ -301,2 +301,3 @@ "use strict"; | ||
isProjectValid, | ||
isSortValid, | ||
isLimitValid, | ||
@@ -303,0 +304,0 @@ isSkipValid, |
@@ -439,2 +439,3 @@ "use strict"; | ||
it('should allow objects and arrays as values', function () { | ||
assert_1.default.deepEqual((0, index_1.isSortValid)(''), null); | ||
assert_1.default.deepEqual((0, index_1.isSortValid)('{_id: 1}'), { _id: 1 }); | ||
@@ -489,3 +490,12 @@ assert_1.default.deepEqual((0, index_1.isSortValid)('{_id: -1}'), { _id: -1 }); | ||
}); | ||
describe('validate', function () { | ||
it('calls the other validation functions', function () { | ||
assert_1.default.deepEqual((0, index_1.isSortValid)(''), null); | ||
assert_1.default.deepEqual((0, index_1.validate)('sort', ''), null); | ||
assert_1.default.deepEqual((0, index_1.validate)('Sort', ''), null); | ||
assert_1.default.deepEqual((0, index_1.validate)('sort', '[["123", -1]]'), [['123', -1]]); | ||
assert_1.default.deepEqual((0, index_1.validate)('limit', ' '), index_1.DEFAULT_LIMIT); | ||
}); | ||
}); | ||
}); | ||
//# sourceMappingURL=index.test.js.map |
{ | ||
"name": "mongodb-query-parser", | ||
"description": "Parse MongoDB queries", | ||
"version": "3.1.2", | ||
"version": "3.1.3", | ||
"author": { | ||
@@ -6,0 +6,0 @@ "name": "MongoDB Inc", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
100232
1.29%1328
0.84%