cf-crud-service-api-builder
Advanced tools
Comparing version 0.1.2 to 0.1.3
@@ -26,3 +26,3 @@ module.exports = createFilterParser | ||
value = newValue | ||
} else if (typeof value === 'object') { | ||
} else if (typeof value === 'object' && null !== value) { | ||
value = parseObject(value, key) | ||
@@ -29,0 +29,0 @@ } else { |
@@ -5,3 +5,3 @@ { | ||
"description": "Build an HTTP API for a crud-service", | ||
"version": "0.1.2", | ||
"version": "0.1.3", | ||
"tags": [], | ||
@@ -8,0 +8,0 @@ "repository": { |
@@ -63,2 +63,8 @@ var schemata = require('schemata') | ||
it('should not error on null', function () { | ||
var params = { number: null } | ||
params = filterParser(params) | ||
assert.equal(null, params.number) | ||
}) | ||
}) | ||
@@ -65,0 +71,0 @@ |
@@ -104,2 +104,10 @@ var assert = require('assert') | ||
it('should default req.query.sort to undefined (number)', function (done) { | ||
var req = { query: { sort: '1' } } | ||
parseQueryString(req, {}, function () { | ||
assert.equal(undefined, req.query.sort) | ||
done() | ||
}) | ||
}) | ||
it('should default req.query.sort direction to "asc"', function (done) { | ||
@@ -106,0 +114,0 @@ var req = { query: { sort: JSON.stringify([ 'a' ]) } } |
20627
511