|
|
@ -2,6 +2,7 @@ var geo_common = require ('./_geo_common'); |
|
|
|
var LAT_LON_IS_REQUIRED = false; |
|
|
|
var LAT_LON_IS_REQUIRED = false; |
|
|
|
var RECT_IS_REQUIRED = false; |
|
|
|
var RECT_IS_REQUIRED = false; |
|
|
|
var CIRCLE_IS_REQUIRED = false; |
|
|
|
var CIRCLE_IS_REQUIRED = false; |
|
|
|
|
|
|
|
var VIEWPORT_IS_REQUIRED = false; |
|
|
|
|
|
|
|
|
|
|
|
// validate inputs, convert types and apply defaults
|
|
|
|
// validate inputs, convert types and apply defaults
|
|
|
|
module.exports = function sanitize( raw, clean ){ |
|
|
|
module.exports = function sanitize( raw, clean ){ |
|
|
@ -13,6 +14,7 @@ module.exports = function sanitize( raw, clean ){ |
|
|
|
geo_common.sanitize_point( 'focus.point', clean, raw, LAT_LON_IS_REQUIRED ); |
|
|
|
geo_common.sanitize_point( 'focus.point', clean, raw, LAT_LON_IS_REQUIRED ); |
|
|
|
geo_common.sanitize_rect( 'boundary.rect', clean, raw, RECT_IS_REQUIRED ); |
|
|
|
geo_common.sanitize_rect( 'boundary.rect', clean, raw, RECT_IS_REQUIRED ); |
|
|
|
geo_common.sanitize_circle( 'boundary.circle', clean, raw, CIRCLE_IS_REQUIRED ); |
|
|
|
geo_common.sanitize_circle( 'boundary.circle', clean, raw, CIRCLE_IS_REQUIRED ); |
|
|
|
|
|
|
|
geo_common.sanitize_rect( 'focus.viewport', clean, raw, VIEWPORT_IS_REQUIRED ); |
|
|
|
} |
|
|
|
} |
|
|
|
catch (err) { |
|
|
|
catch (err) { |
|
|
|
messages.errors.push( err.message ); |
|
|
|
messages.errors.push( err.message ); |
|
|
|