You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

22 lines
583 B

10 years ago
var geo_common = require ('./_geo_common');
10 years ago
var LAT_LON_IS_REQUIRED = false;
// validate inputs, convert types and apply defaults
10 years ago
module.exports = function sanitize( raw, clean ){
10 years ago
// error & warning messages
var messages = { errors: [], warnings: [] };
try {
10 years ago
geo_common.sanitize_coord( 'lat', clean, raw['focus.point.lat'], LAT_LON_IS_REQUIRED );
geo_common.sanitize_coord( 'lon', clean, raw['focus.point.lon'], LAT_LON_IS_REQUIRED );
geo_common.sanitize_bbox(raw, clean);
}
catch (err) {
10 years ago
messages.errors.push( err.message );
}
10 years ago
return messages;
};