From f9670bf7e4cff73c60b64ea62b09614cd2fd1af5 Mon Sep 17 00:00:00 2001 From: Severyn Kozak Date: Thu, 23 Apr 2015 11:21:24 -0400 Subject: [PATCH] Use is-object, addressing https://github.com/pelias/api/pull/113/files#r28972145. --- query/sort.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/query/sort.js b/query/sort.js index e0a0b64f..4e72ef45 100644 --- a/query/sort.js +++ b/query/sort.js @@ -2,6 +2,7 @@ var admin_boost = 'admin_boost'; var population = 'population'; var popularity = 'popularity'; var weights = require('pelias-suggester-pipeline').weights; +var isObject = require( 'is-object' ); module.exports = function( params ){ var scriptsConfig = [ @@ -38,7 +39,7 @@ module.exports = function( params ){ } ]; - if( typeof params === 'object' && params.hasOwnProperty( 'input' ) ){ + if( isObject( params ) && params.hasOwnProperty( 'input' ) ){ scriptsConfig.push({ _script: { params: {