From 9fdddd3834bbd1d14ced16d237ff7363d2880e84 Mon Sep 17 00:00:00 2001 From: Stephen Hess Date: Tue, 22 Sep 2015 13:56:54 -0400 Subject: [PATCH] unrolled not-not conditional to positive conditional --- sanitiser/_geo_common.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/sanitiser/_geo_common.js b/sanitiser/_geo_common.js index 4e0f8c9b..00112d89 100644 --- a/sanitiser/_geo_common.js +++ b/sanitiser/_geo_common.js @@ -2,7 +2,8 @@ * helper sanitiser methods for geo parameters */ var util = require('util'), - check = require('check-types'); + check = require('check-types'), + _ = require('lodash'); /** * Parse and validate rect parameter @@ -55,6 +56,8 @@ 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' ]; @@ -144,7 +147,7 @@ function sanitize_point( key_prefix, clean, raw, point_is_required ) { */ function sanitize_coord( key, clean, param, latlon_is_required ) { var value = parseFloat( param ); - if ( !isNaN( value ) ) { + if ( _.isFinite( value ) ) { clean[key] = value; } else if (latlon_is_required) {