From c129dec3bf78b2c802ebcdc90467d0f61275eab2 Mon Sep 17 00:00:00 2001 From: Stephen Hess Date: Mon, 5 Jun 2017 16:11:15 -0400 Subject: [PATCH] switch to _.defaultTo since it's more descriptive --- routes/v1.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/routes/v1.js b/routes/v1.js index 4791b67a..872c846f 100644 --- a/routes/v1.js +++ b/routes/v1.js @@ -88,11 +88,11 @@ const PlaceHolder = require('../service/configurations/PlaceHolder'); function addRoutes(app, peliasConfig) { const esclient = elasticsearch.Client(peliasConfig.esclient); - const pipConfiguration = new PointInPolygon(peliasConfig.api.services.pip); + const pipConfiguration = new PointInPolygon(_.defaultTo(peliasConfig.api.services.pip, {})); const pipService = serviceWrapper(pipConfiguration); const isPipServiceEnabled = _.constant(pipConfiguration.isEnabled()); - const placeholderConfiguration = new PlaceHolder(_.get(peliasConfig.api.services, 'placeholder', {})); + const placeholderConfiguration = new PlaceHolder(_.defaultTo(peliasConfig.api.services.placeholder, {})); const placeholderService = serviceWrapper(placeholderConfiguration); const isPlaceholderServiceEnabled = _.constant(placeholderConfiguration.isEnabled());