From b3a3155c5e43a7834bc6689e80b1e4ab576292cf Mon Sep 17 00:00:00 2001 From: Daniel Nalborczyk Date: Wed, 3 Jul 2019 23:48:23 -0400 Subject: [PATCH] Linting: use const --- src/createVelocityContext.js | 2 +- src/renderVelocityTemplateObject.js | 2 +- src/utils.js | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/createVelocityContext.js b/src/createVelocityContext.js index 7a747b7cd..690613db1 100644 --- a/src/createVelocityContext.js +++ b/src/createVelocityContext.js @@ -9,7 +9,7 @@ function escapeJavaScript(x) { if (typeof x === 'string') return jsEscapeString(x).replace(/\\n/g, '\n'); // See #26, if (isPlainObject(x)) { const result = {}; - for (let key in x) { // eslint-disable-line prefer-const + for (const key in x) { // eslint-disable-line prefer-const result[key] = jsEscapeString(x[key]); } diff --git a/src/renderVelocityTemplateObject.js b/src/renderVelocityTemplateObject.js index ed5fcb756..16c689025 100644 --- a/src/renderVelocityTemplateObject.js +++ b/src/renderVelocityTemplateObject.js @@ -64,7 +64,7 @@ module.exports = function renderVelocityTemplateObject(templateObject, context) // Let's check again if (isPlainObject(toProcess)) { - for (let key in toProcess) { // eslint-disable-line prefer-const + for (const key in toProcess) { // eslint-disable-line prefer-const const value = toProcess[key]; debugLog('Processing key:', key, '- value:', value); diff --git a/src/utils.js b/src/utils.js index 9ba07d491..db799f90a 100644 --- a/src/utils.js +++ b/src/utils.js @@ -28,7 +28,7 @@ module.exports = { capitalizeKeys: o => { const capitalized = {}; - for (let key in o) { // eslint-disable-line prefer-const + for (const key in o) { // eslint-disable-line prefer-const capitalized[key.replace(/((?:^|-)[a-z])/g, x => x.toUpperCase())] = o[key]; }