mirror of https://github.com/status-im/codimd.git
refactor: fix lint on lib/config/index.js
Signed-off-by: BoHong Li <raccoon@hackmd.io>
This commit is contained in:
parent
ac8160c650
commit
898174426c
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue