Skip to content

Commit

Permalink
Replaced concatenated strings with template literals in the readers/i…
Browse files Browse the repository at this point in the history
…ni.js (#35)

updates: haraka/Haraka#2129
  • Loading branch information
PSSGCSim authored and msimerson committed Sep 30, 2017
1 parent 33c02e7 commit fd2dfba
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions readers/ini.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ exports.load = function (name, options, regex) {
match = regex.param.exec(line);
if (!match) {
exports.logger(
'Invalid line in config file \'' + name + '\': ' + line);
`Invalid line in config file '${name}': ${line}`);
return;
}

Expand All @@ -61,13 +61,12 @@ exports.load = function (name, options, regex) {

if (options && Array.isArray(options.booleans) &&
(
exports.bool_matches.indexOf(current_sect_name + '.' + match[1]) !== -1
exports.bool_matches.indexOf(`${current_sect_name}.${match[1]}`) !== -1
||
exports.bool_matches.indexOf('*.' + match[1]) !== -1
exports.bool_matches.indexOf(`*.${match[1]}`) !== -1
)) {
current_sect[match[1]] = regex.is_truth.test(match[2]);
// var msg = 'Using boolean ' + current_sect[match[1]] +
// ' for ' + current_sect_name + '.' + match[1] + '=' + match[2];
// var msg = `Using boolean ${current_sect[match[1]]} for ${current_sect_name}.${match[1]}=${match[2]}`;
// exports.logger(msg, 'logdebug');
}
else if (regex.is_integer.test(match[2])) {
Expand Down Expand Up @@ -111,8 +110,8 @@ exports.init_booleans = function (options, result) {
if (section === '*') continue; // wildcard, don't initialize

// so boolean detection in the next section will match
if (options.booleans.indexOf(section + '.' + key) === -1) {
this.bool_matches.push(section + '.' + key);
if (options.booleans.indexOf(`${section}.${key}`) === -1) {
this.bool_matches.push(`${section}.${key}`);
}

if (!result[section]) result[section] = {};
Expand Down

0 comments on commit fd2dfba

Please sign in to comment.