From e8d5e42300e185b2fb8b7e82e28ef6589a46a15e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Garc=C3=ADa=20Aubert?= Date: Fri, 13 Sep 2019 17:58:23 +0200 Subject: [PATCH] Use Object.assign() instead of _.defaults() --- lib/cartodb/cache/named_map_provider_cache.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/lib/cartodb/cache/named_map_provider_cache.js b/lib/cartodb/cache/named_map_provider_cache.js index 0160eb20..de879c73 100644 --- a/lib/cartodb/cache/named_map_provider_cache.js +++ b/lib/cartodb/cache/named_map_provider_cache.js @@ -1,6 +1,5 @@ 'use strict'; -var _ = require('underscore'); var NamedMapMapConfigProvider = require('../models/mapconfig/provider/named-map-provider'); var templateName = require('../backends/template_maps').templateName; @@ -70,12 +69,14 @@ function createNamedMapKey(user, templateId) { var providerKeyTpl = ctx => `${ctx.authToken}:${ctx.configHash}:${ctx.format}:${ctx.layer}:${ctx.scale_factor}`; function createProviderKey(config, authToken, params) { - var tplValues = _.defaults({}, params, { + const defaults = { authToken: authToken || '', configHash: NamedMapMapConfigProvider.configHash(config), layer: '', format: '', scale_factor: 1 - }); - return providerKeyTpl(tplValues); + }; + const ctx = Object.assign({}, defaults, params); + + return providerKeyTpl(ctx); }