Use template strings

This commit is contained in:
Daniel García Aubert
2018-03-08 12:35:54 +01:00
parent 49bcc5368d
commit aae814a156

View File

@@ -441,7 +441,7 @@ function getPreviewImageByCenter (previewBackend) {
res.set(headers);
}
res.set('Content-Type', headers['Content-Type'] || 'image/' + format);
res.set('Content-Type', headers['Content-Type'] || `image/${format}`);
res.body = image;
@@ -464,7 +464,7 @@ function getPreviewImageByBoundingBox (previewBackend) {
const { mapConfigProvider: provider } = res.locals;
previewBackend.getImage(provider, format, width, height, bounds, (err, image, headers, stats = {}) => {
req.profiler.done('render-' + format);
req.profiler.done(`render-${format}`);
req.profiler.add(stats);
if (err) {
@@ -476,7 +476,7 @@ function getPreviewImageByBoundingBox (previewBackend) {
res.set(headers);
}
res.set('Content-Type', headers['Content-Type'] || 'image/' + format);
res.set('Content-Type', headers['Content-Type'] || `image/${format}`);
res.body = image;
@@ -518,7 +518,7 @@ function getAffectedTables (layergroupAffectedTables, pgConnection) {
pgConnection.getConnection(user, (err, connection) => {
if (err) {
global.logger.warn('ERROR generating cache channel: ' + err);
global.logger.warn('ERROR generating cache channel:', err);
return next();
}
@@ -527,7 +527,7 @@ function getAffectedTables (layergroupAffectedTables, pgConnection) {
sql.push(layer.options.sql);
if (layer.options.affected_tables) {
layer.options.affected_tables.map(function(table) {
sql.push('SELECT * FROM ' + table + ' LIMIT 0');
sql.push(`SELECT * FROM ${table} LIMIT 0`);
});
}
});
@@ -535,7 +535,7 @@ function getAffectedTables (layergroupAffectedTables, pgConnection) {
QueryTables.getAffectedTablesFromQuery(connection, sql.join(';'), (err, affectedTables) => {
req.profiler.done('getAffectedTablesFromQuery');
if (err) {
global.logger.warn('ERROR generating cache channel: ' + err);
global.logger.warn('ERROR generating cache channel: ', err);
return next();
}
@@ -623,7 +623,7 @@ function tileError () {
const matches = errMsg.match("(.*) in style 'layer([0-9]+)'");
if (matches) {
errMsg = 'style' + matches[2] + ': ' + matches[1];
errMsg = `style${matches[2]}: ${matches[1]}`;
}
err.message = errMsg;