diff --git a/lib/render/engineScript.js b/lib/render/engineScript.js index 56aa472..c2f31bd 100644 --- a/lib/render/engineScript.js +++ b/lib/render/engineScript.js @@ -36,7 +36,7 @@ module.exports = function (inputs, callback, done) { let isFromCache = true - let engine = (template) => { + const engine = (template) => { const key = template + ':' + inputs.engine if (!compiledCache.get(key)) { @@ -56,9 +56,6 @@ module.exports = function (inputs, callback, done) { inputs.parentModuleDirectory ] - let consoleFromSandbox - let consoleMessages = [] - function respondWrap (rawErr, content) { let err @@ -146,8 +143,8 @@ module.exports = function (inputs, callback, done) { } ) - consoleMessages = messages - consoleFromSandbox = consoleSandbox + const consoleMessages = messages + const consoleFromSandbox = consoleSandbox let templateHelpers = inputs.template.helpers let originalTemplateHelpersStr @@ -166,7 +163,7 @@ module.exports = function (inputs, callback, done) { templateHelpers = {} - for (let fn in sandboxContext) { + for (const fn in sandboxContext) { if (typeof sandboxContext[fn] === 'function') { templateHelpers[fn] = sandboxContext[fn] } diff --git a/lib/render/safeSandbox.js b/lib/render/safeSandbox.js index 857ae6f..2cd27e5 100644 --- a/lib/render/safeSandbox.js +++ b/lib/render/safeSandbox.js @@ -111,7 +111,7 @@ module.exports = (_sandbox, options = {}) => { return result } - for (let name in sandbox) { + for (const name in sandbox) { vm._internal.Contextify.globalValue(sandbox[name], name) } diff --git a/lib/store/collection.js b/lib/store/collection.js index eb20368..949dc4a 100644 --- a/lib/store/collection.js +++ b/lib/store/collection.js @@ -143,7 +143,7 @@ module.exports = (entitySet, provider, model) => ({ return docs.map((doc) => { const newDoc = Object.assign({}, doc) - for (let prop in newDoc) { + for (const prop in newDoc) { if (!prop) { continue } @@ -170,7 +170,7 @@ module.exports = (entitySet, provider, model) => ({ return docs.map((doc) => { const newDoc = Object.assign({}, doc) - for (let prop in newDoc) { + for (const prop in newDoc) { if (!prop) { continue } diff --git a/lib/store/documentStore.js b/lib/store/documentStore.js index 6ab98b4..a688861 100644 --- a/lib/store/documentStore.js +++ b/lib/store/documentStore.js @@ -237,7 +237,7 @@ function typeDefToJSONSchema (model, def) { const propDef = def[key] const collectionTypeRegExp = /^Collection\((\S+)\)$/ let type = propDef.type - let extraSchema = propDef.schema + const extraSchema = propDef.schema let isCollection = false if (propDef == null || type == null) { diff --git a/test/render/engineTest.js b/test/render/engineTest.js index 377f58b..3d41090 100644 --- a/test/render/engineTest.js +++ b/test/render/engineTest.js @@ -6,7 +6,7 @@ const safeSandboxPath = path.join(__dirname, '../../lib/render/safeSandbox') describe('engine', () => { describe('engine with dedicated-process strategy', () => { - let scriptManager = ScriptManager({ strategy: 'dedicated-process' }) + const scriptManager = ScriptManager({ strategy: 'dedicated-process' }) beforeEach((done) => { scriptManager.ensureStarted(done) @@ -17,7 +17,7 @@ describe('engine', () => { }) describe('engine with http-server strategy', () => { - let scriptManager = ScriptManager({ strategy: 'http-server' }) + const scriptManager = ScriptManager({ strategy: 'http-server' }) beforeEach((done) => { scriptManager.ensureStarted(done) @@ -29,7 +29,7 @@ describe('engine', () => { }) describe('engine with in-process strategy', function () { - let scriptManager = ScriptManager({ strategy: 'in-process' }) + const scriptManager = ScriptManager({ strategy: 'in-process' }) beforeEach((done) => { scriptManager.ensureStarted(done) diff --git a/test/reporterTest.js b/test/reporterTest.js index f890911..a9125cc 100644 --- a/test/reporterTest.js +++ b/test/reporterTest.js @@ -76,7 +76,7 @@ describe('reporter', () => { } }) stdMocks.restore() - let stdoutContent = stdMocks.flush() + const stdoutContent = stdMocks.flush() stdoutContent.stdout.length.should.be.eql(0) const allTransportsAreSilent = Object.keys(reporter.logger.transports).every(function (transportName) {