diff --git a/helper/geojsonify.js b/helper/geojsonify.js index 484ef75f..4b8ea555 100644 --- a/helper/geojsonify.js +++ b/helper/geojsonify.js @@ -12,7 +12,7 @@ function search( docs, details ){ return false; // remove offending doc from results } - details = details || false; + details = details === true || details === 1; // flatten & expand data for geojson conversion var geodata = docs.map( function( doc ){ diff --git a/test/unit/helper/geojsonify.js b/test/unit/helper/geojsonify.js index c94f45dd..789bc5cc 100644 --- a/test/unit/helper/geojsonify.js +++ b/test/unit/helper/geojsonify.js @@ -178,7 +178,7 @@ module.exports.tests.search = function(test, common) { ] }; - var truthy_params = [true, 1, -1, 123, 'abc']; + var truthy_params = [true, 1]; test('geojsonify.search(doc, true) with details', function(t) { var json = geojsonify.search( input, true ); @@ -252,7 +252,7 @@ module.exports.tests.search = function(test, common) { t.end(); }); - var falsy_params = [false, undefined, null, 0 ]; + var falsy_params = [false, undefined, null, 0, -1, 123, 'abc']; falsy_params.forEach(function(details) { test('geojsonify.search(doc, '+ details +') with no details', function(t) {