|
|
@ -2,14 +2,14 @@ var isObject = require('is-object'); |
|
|
|
|
|
|
|
|
|
|
|
// validate inputs, convert types and apply defaults
|
|
|
|
// validate inputs, convert types and apply defaults
|
|
|
|
function sanitize( req, default_value ){ |
|
|
|
function sanitize( req, default_value ){ |
|
|
|
|
|
|
|
|
|
|
|
var clean = req.clean || {}; |
|
|
|
var clean = req.clean || {}; |
|
|
|
var params= req.query; |
|
|
|
var params= req.query; |
|
|
|
|
|
|
|
|
|
|
|
if (default_value === undefined) { |
|
|
|
if (default_value === undefined) { |
|
|
|
default_value = true; |
|
|
|
default_value = true; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
default_value = !!default_value; |
|
|
|
default_value = !!default_value; |
|
|
|
|
|
|
|
|
|
|
|
// ensure the input params are a valid object
|
|
|
|
// ensure the input params are a valid object
|
|
|
@ -24,7 +24,7 @@ function sanitize( req, default_value ){ |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
req.clean = clean; |
|
|
|
req.clean = clean; |
|
|
|
|
|
|
|
|
|
|
|
return {'error':false}; |
|
|
|
return {'error':false}; |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|