mirror of https://github.com/pelias/api.git
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.
19 lines
564 B
19 lines
564 B
var geo_common = require ('./_geo_common'); |
|
var LAT_LON_IS_REQUIRED = false; |
|
|
|
// validate inputs, convert types and apply defaults |
|
module.exports = function sanitize( raw, clean ){ |
|
|
|
// error & warning messages |
|
var messages = { errors: [], warnings: [] }; |
|
|
|
try { |
|
geo_common.sanitize_coord( 'focus.point.lat', clean, raw['focus.point.lat'], LAT_LON_IS_REQUIRED ); |
|
geo_common.sanitize_coord( 'focus.point.lon', clean, raw['focus.point.lon'], LAT_LON_IS_REQUIRED ); |
|
} |
|
catch (err) { |
|
messages.errors.push( err.message ); |
|
} |
|
|
|
return messages; |
|
};
|
|
|