From 0595a290524d9fbfd720bcc6f7d0703a4fbe9d46 Mon Sep 17 00:00:00 2001 From: Stephen Hess Date: Tue, 22 Sep 2015 14:11:54 -0400 Subject: [PATCH] renamed parameters for readability --- sanitiser/_geo_common.js | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/sanitiser/_geo_common.js b/sanitiser/_geo_common.js index 00112d89..c74db609 100644 --- a/sanitiser/_geo_common.js +++ b/sanitiser/_geo_common.js @@ -56,8 +56,6 @@ function sanitize_rect( key_prefix, clean, raw, bbox_is_required ) { * @param {bool} circle_is_required */ function sanitize_circle( key_prefix, clean, raw, circle_is_required ) { - // "boundary.circle", clean, raw, true - // the names we use to define the centroid var mandatoryProps = [ 'lat', 'lon' ]; @@ -142,13 +140,13 @@ function sanitize_point( key_prefix, clean, raw, point_is_required ) { * * @param {string} key * @param {object} clean - * @param {string} param + * @param {string} rawValue * @param {bool} latlon_is_required */ -function sanitize_coord( key, clean, param, latlon_is_required ) { - var value = parseFloat( param ); - if ( _.isFinite( value ) ) { - clean[key] = value; +function sanitize_coord( key, clean, rawValue, latlon_is_required ) { + var parsedValue = parseFloat( rawValue ); + if ( _.isFinite( parsedValue ) ) { + clean[key] = parsedValue; } else if (latlon_is_required) { throw new Error( util.format( 'missing param \'%s\'', key ) );