Browse Source

Replace array iteration boilerplate with .map

Keeps the focus of the code on the actions to be performed, rather than
the grunt work of iterating through the array.
pull/178/head
Julian Simioni 10 years ago
parent
commit
17ba5da6d5
  1. 10
      sanitiser/_geo.js

10
sanitiser/_geo.js

@ -50,14 +50,10 @@ function sanitize_bbox( clean, param ) {
var bboxArr = param.split( ',' );
if( Array.isArray( bboxArr ) && bboxArr.length === 4 ) {
var bbox = bboxArr.map(parseFloat);
var bbox = [];
for( var ind = 0; ind < bboxArr.length; ind++ ){
var num = parseFloat( bboxArr[ ind ] );
if( isNaN( num ) ){
return;
}
bbox.push( num );
if (bbox.some(isNaN)) {
return;
}
clean.bbox = {

Loading…
Cancel
Save