refactor: fix lint on lib/config/index.js

Signed-off-by: BoHong Li <raccoon@hackmd.io>
This commit is contained in:
BoHong Li 2019-08-02 00:57:39 +08:00
parent ac8160c650
commit 898174426c
No known key found for this signature in database
GPG Key ID: 06770355DC9ECD38
1 changed files with 8 additions and 8 deletions

View File

@ -53,14 +53,14 @@ if (['debug', 'verbose', 'info', 'warn', 'error'].includes(config.loglevel)) {
// load LDAP CA
if (config.ldap.tlsca) {
let ca = config.ldap.tlsca.split(',')
let caContent = []
for (let i of ca) {
if (fs.existsSync(i)) {
caContent.push(fs.readFileSync(i, 'utf8'))
const certificateAuthorities = config.ldap.tlsca.split(',')
const caContent = []
for (const ca of certificateAuthorities) {
if (fs.existsSync(ca)) {
caContent.push(fs.readFileSync(ca, 'utf8'))
}
}
let tlsOptions = {
const tlsOptions = {
ca: caContent
}
config.ldap.tlsOptions = config.ldap.tlsOptions ? Object.assign(config.ldap.tlsOptions, tlsOptions) : tlsOptions
@ -134,10 +134,10 @@ config.isGitlabSnippetsEnable = (!config.gitlab.scope || config.gitlab.scope ===
config.updateI18nFiles = (env === Environment.development)
// merge legacy values
let keys = Object.keys(config)
const keys = Object.keys(config)
const uppercase = /[A-Z]/
for (let i = keys.length; i--;) {
let lowercaseKey = keys[i].toLowerCase()
const lowercaseKey = keys[i].toLowerCase()
// if the config contains uppercase letters
// and a lowercase version of this setting exists
// and the config with uppercase is not set