Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replaced concatenated strings with template literals in the readers/ini.js #35

Merged
merged 3 commits into from Sep 30, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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