camel case

This commit is contained in:
Daniel García Aubert
2019-11-14 12:17:26 +01:00
parent f9082dad94
commit d4719d5707
19 changed files with 139 additions and 139 deletions
+5 -5
View File
@@ -6,12 +6,12 @@ module.exports = function setLastModifiedHeader () {
return next();
}
const { mapConfigProvider, cache_buster } = res.locals;
const { mapConfigProvider, cache_buster: cacheBuster } = res.locals;
if (cache_buster) {
const cacheBuster = parseInt(cache_buster, 10);
const lastModifiedDate = Number.isFinite(cacheBuster) && cacheBuster !== 0
? new Date(cacheBuster)
if (cacheBuster) {
const cacheBusterTimestamp = parseInt(cacheBuster, 10);
const lastModifiedDate = Number.isFinite(cacheBusterTimestamp) && cacheBusterTimestamp !== 0
? new Date(cacheBusterTimestamp)
: new Date();
res.set('Last-Modified', lastModifiedDate.toUTCString());
@@ -10,16 +10,16 @@ module.exports = function createMapStoreMapConfigProvider (
forcedFormat = null
) {
return function createMapStoreMapConfigProviderMiddleware (req, res, next) {
const { user, token, cache_buster, api_key } = res.locals;
const { user, token, cache_buster: cacheBuster, api_key: apiKey } = res.locals;
const { dbuser, dbname, dbpassword, dbhost, dbport } = res.locals;
const { layer: layerFromParams, z, x, y, scale_factor, format } = req.params;
const { layer: layerFromParams, z, x, y, scale_factor: scaleFactor, format } = req.params;
const { layer: layerFromQuery } = req.query;
const params = {
user,
token,
cache_buster,
api_key,
cache_buster: cacheBuster,
api_key: apiKey,
dbuser,
dbname,
dbpassword,
@@ -29,7 +29,7 @@ module.exports = function createMapStoreMapConfigProvider (
z,
x,
y,
scale_factor,
scale_factor: scaleFactor,
format
};
+7 -7
View File
@@ -2,22 +2,22 @@
module.exports = function getNamedMapProvider ({ namedMapProviderCache, label, forcedFormat = null }) {
return function getNamedMapProviderMiddleware (req, res, next) {
const { user, token, cache_buster, api_key } = res.locals;
const { user, token, cache_buster: cacheBuster, api_key: apiKey } = res.locals;
const { dbuser, dbname, dbpassword, dbhost, dbport } = res.locals;
const { template_id, layer: layerFromParams, z, x, y, format } = req.params;
const { template_id: templateId, layer: layerFromParams, z, x, y, format } = req.params;
const { layer: layerFromQuery } = req.query;
const params = {
user,
token,
cache_buster,
api_key,
cache_buster: cacheBuster,
api_key: apiKey,
dbuser,
dbname,
dbpassword,
dbhost,
dbport,
template_id,
template_id: templateId,
layer: (layerFromQuery || layerFromParams),
z,
x,
@@ -30,9 +30,9 @@ module.exports = function getNamedMapProvider ({ namedMapProviderCache, label, f
params.layer = params.layer || 'all';
}
const { config, auth_token } = req.query;
const { config, auth_token: authToken } = req.query;
namedMapProviderCache.get(user, template_id, config, auth_token, params, (err, namedMapProvider) => {
namedMapProviderCache.get(user, templateId, config, authToken, params, (err, namedMapProvider) => {
if (err) {
err.label = label;
return next(err);