Skip to content
This repository was archived by the owner on Apr 3, 2019. It is now read-only.

Commit 29c9f39

Browse files
seanmonstarphilbooth
authored andcommitted
style(lib): update let to const when possible
#1652 r=philbooth
1 parent 9c23b0a commit 29c9f39

File tree

7 files changed

+23
-23
lines changed

7 files changed

+23
-23
lines changed

lib/routes/account.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -461,7 +461,7 @@ module.exports = function (
461461
function checkIsBlockForced () {
462462
// For testing purposes, some email addresses are forced
463463
// to go through signin unblock on every login attempt.
464-
let forced = config.signinUnblock && config.signinUnblock.enabled && config.signinUnblock.forcedEmailAddresses
464+
const forced = config.signinUnblock && config.signinUnblock.enabled && config.signinUnblock.forcedEmailAddresses
465465

466466
if (forced && forced.test(email)) {
467467
return P.reject(error.requestBlocked(true))
@@ -764,7 +764,7 @@ module.exports = function (
764764
}
765765
})
766766
.then(() => {
767-
let sessionTokenOptions = {
767+
const sessionTokenOptions = {
768768
uid: emailRecord.uid,
769769
email: emailRecord.email,
770770
emailCode: emailRecord.emailCode,
@@ -1671,7 +1671,7 @@ module.exports = function (
16711671
)
16721672
.then(
16731673
(account) => {
1674-
let isAccountVerification = butil.buffersAreEqual(code, account.emailCode)
1674+
const isAccountVerification = butil.buffersAreEqual(code, account.emailCode)
16751675

16761676
/**
16771677
* Logic for account and token verification

lib/routes/password.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,7 @@ module.exports = function (
277277
})
278278
.then(maybeToken => {
279279
// Create a sessionToken with the verification status of the current session
280-
let sessionTokenOptions = {
280+
const sessionTokenOptions = {
281281
uid: account.uid,
282282
email: account.email,
283283
emailCode: account.emailCode,

npm-shrinkwrap.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

test/local/lib/log.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ describe('log', () => {
111111
log.activityEvent()
112112

113113
assert.equal(logger.error.callCount, 1, 'logger.error was called once')
114-
let args = logger.error.args[0]
114+
const args = logger.error.args[0]
115115
assert.equal(args.length, 2, 'logger.error was passed two arguments')
116116
assert.equal(args[0], 'log.activityEvent', 'first argument was function name')
117117
assert.deepEqual(args[1], {
@@ -137,7 +137,7 @@ describe('log', () => {
137137
})
138138

139139
assert.equal(logger.error.callCount, 1, 'logger.error was called once')
140-
let args = logger.error.args[0]
140+
const args = logger.error.args[0]
141141
assert.equal(args.length, 2, 'logger.error was passed two arguments')
142142
assert.equal(args[0], 'log.activityEvent', 'first argument was function name')
143143
assert.deepEqual(args[1], {
@@ -165,7 +165,7 @@ describe('log', () => {
165165
})
166166

167167
assert.equal(logger.error.callCount, 1, 'logger.error was called once')
168-
let args = logger.error.args[0]
168+
const args = logger.error.args[0]
169169
assert.equal(args.length, 2, 'logger.error was passed two arguments')
170170
assert.equal(args[0], 'log.activityEvent', 'first argument was function name')
171171
assert.deepEqual(args[1], {
@@ -222,7 +222,7 @@ describe('log', () => {
222222
log.flowEvent()
223223

224224
assert.equal(logger.error.callCount, 1, 'logger.error was called once')
225-
let args = logger.error.args[0]
225+
const args = logger.error.args[0]
226226
assert.equal(args.length, 2, 'logger.error was passed two arguments')
227227
assert.equal(args[0], 'log.flowEvent', 'first argument was function name')
228228
assert.deepEqual(args[1], {
@@ -250,7 +250,7 @@ describe('log', () => {
250250
})
251251

252252
assert.equal(logger.error.callCount, 1, 'logger.error was called once')
253-
let args = logger.error.args[0]
253+
const args = logger.error.args[0]
254254
assert.equal(args.length, 2, 'logger.error was passed two arguments')
255255
assert.equal(args[0], 'log.flowEvent', 'first argument was function name')
256256
assert.deepEqual(args[1], {
@@ -282,7 +282,7 @@ describe('log', () => {
282282
})
283283

284284
assert.equal(logger.error.callCount, 1, 'logger.error was called once')
285-
let args = logger.error.args[0]
285+
const args = logger.error.args[0]
286286
assert.equal(args.length, 2, 'logger.error was passed two arguments')
287287
assert.equal(args[0], 'log.flowEvent', 'first argument was function name')
288288
assert.deepEqual(args[1], {
@@ -314,7 +314,7 @@ describe('log', () => {
314314
})
315315

316316
assert.equal(logger.error.callCount, 1, 'logger.error was called once')
317-
let args = logger.error.args[0]
317+
const args = logger.error.args[0]
318318
assert.equal(args.length, 2, 'logger.error was passed two arguments')
319319
assert.equal(args[0], 'log.flowEvent', 'first argument was function name')
320320
assert.deepEqual(args[1], {
@@ -346,7 +346,7 @@ describe('log', () => {
346346
})
347347

348348
assert.equal(logger.error.callCount, 1, 'logger.error was called once')
349-
let args = logger.error.args[0]
349+
const args = logger.error.args[0]
350350
assert.equal(args.length, 2, 'logger.error was passed two arguments')
351351
assert.equal(args[0], 'log.flowEvent', 'first argument was function name')
352352
assert.deepEqual(args[1], {

test/local/lib/server.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@ describe('lib/server', () => {
1515
})
1616

1717
describe('logEndpointErrors', () => {
18-
let msg = 'Timeout'
19-
let reason = 'Socket fail'
20-
let response = {
18+
const msg = 'Timeout'
19+
const reason = 'Socket fail'
20+
const response = {
2121
__proto__: {
2222
name: 'EndpointError'
2323
},

test/local/pool.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ describe('Pool', () => {
7777
'pool.request callback with error',
7878
() => {
7979
var pool = new Pool('http://example.com/')
80-
let p = pool.request()
80+
const p = pool.request()
8181
.then(function () {
8282
assert(false, 'request should have failed')
8383
}, function (error) {
@@ -96,7 +96,7 @@ describe('Pool', () => {
9696
'pool.request callback with HTTP error response',
9797
() => {
9898
var pool = new Pool('http://example.com/')
99-
let p = pool.request()
99+
const p = pool.request()
100100
.then(function () {
101101
assert(false, 'request should have failed')
102102
}, function (error) {
@@ -116,7 +116,7 @@ describe('Pool', () => {
116116
'pool.request callback with HTTP error response and JSON body',
117117
() => {
118118
var pool = new Pool('http://example.com/')
119-
let p = pool.request()
119+
const p = pool.request()
120120
.then(function () {
121121
assert(false, 'request should have failed')
122122
}, function (error) {
@@ -137,7 +137,7 @@ describe('Pool', () => {
137137
'pool.request callback with HTTP success response and empty body',
138138
() => {
139139
var pool = new Pool('http://example.com/')
140-
let p = pool.request()
140+
const p = pool.request()
141141
.then(function (result) {
142142
assert.equal(result, undefined, 'result is undefined')
143143
})
@@ -153,7 +153,7 @@ describe('Pool', () => {
153153
'pool.request callback with HTTP success response and valid JSON body',
154154
() => {
155155
var pool = new Pool('http://example.com/')
156-
let p = pool.request()
156+
const p = pool.request()
157157
.then(function (result) {
158158
assert.equal(typeof result, 'object', 'result is object')
159159
assert.equal(Object.keys(result).length, 1, 'result has 1 property')
@@ -171,7 +171,7 @@ describe('Pool', () => {
171171
'pool.request callback with HTTP success response and invalid JSON body',
172172
() => {
173173
var pool = new Pool('http://example.com/')
174-
let p = pool.request()
174+
const p = pool.request()
175175
.then(function () {
176176
assert(false, 'request should have failed')
177177
}, function (error) {

test/test_server.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ TestServer.prototype.stop = function () {
160160
currentServer = undefined
161161
try { this.db.close() } catch (e) {}
162162
if (this.server) {
163-
let doomed = [
163+
const doomed = [
164164
processKill(this.server, 'server', 'SIGINT'),
165165
processKill(this.mail, 'mail')
166166
]

0 commit comments

Comments
 (0)