From c7ed3d34e899ba6b76ee96755d85b140ab0c5725 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Garc=C3=ADa=20Aubert?= Date: Fri, 15 Sep 2017 11:35:06 +0200 Subject: [PATCH] Use const instead of var to declare variables --- lib/cartodb/models/dataview/formula.js | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/lib/cartodb/models/dataview/formula.js b/lib/cartodb/models/dataview/formula.js index c2528a91..1ce0050b 100644 --- a/lib/cartodb/models/dataview/formula.js +++ b/lib/cartodb/models/dataview/formula.js @@ -1,5 +1,5 @@ -var BaseDataview = require('./base'); -var debug = require('debug')('windshaft:dataview:formula'); +const BaseDataview = require('./base'); +const debug = require('debug')('windshaft:dataview:formula'); const countInfinitiesQueryTpl = ctx => ` SELECT count(1) FROM (${ctx._query}) __cdb_formula_infinities @@ -58,7 +58,7 @@ module.exports = class Formula extends BaseDataview { } if (!VALID_OPERATIONS[options.operation]) { - throw new Error(`Formula does not support '${options.operation}' operation`) + throw new Error(`Formula does not support '${options.operation}' operation`); } if (options.operation !== 'count' && typeof options.column !== 'string') { @@ -74,7 +74,7 @@ module.exports = class Formula extends BaseDataview { sql (psql, override, callback) { - var self = this; + const self = this; if (!callback) { callback = override; @@ -92,7 +92,7 @@ module.exports = class Formula extends BaseDataview { return null; } - var formulaSql = formulaQueryTpl({ + const formulaSql = formulaQueryTpl({ _isFloatColumn: this._isFloatColumn, _query: this.query, _operation: this.operation, @@ -123,7 +123,7 @@ module.exports = class Formula extends BaseDataview { getType () { return TYPE; - }; + } toString () { return JSON.stringify({ @@ -133,4 +133,4 @@ module.exports = class Formula extends BaseDataview { _operation: this.operation }); } -} +};