var indeces = require('../query/indeces'); // validate inputs, convert types and apply defaults function sanitize( req ){ var clean = req.clean || {}; var params= req.query; // ensure the input params are a valid object if( Object.prototype.toString.call( params ) !== '[object Object]' ){ params = {}; } // which layers to query if('string' === typeof params.layers && params.layers.length){ var layers = params.layers.split(',').map( function( layer ){ return layer.toLowerCase(); // lowercase inputs }); for( var x=0; x