Code formatting with 2 space indent

This commit is contained in:
Clément GOUIN
2019-06-20 14:24:34 +02:00
parent 3df43b4872
commit 92021164c9
11 changed files with 676 additions and 674 deletions
+17 -17
View File
@@ -8,24 +8,24 @@ const fs = require('fs');
* @returns {*}
*/
const merge = (ref, src) => {
if (typeof ref !== typeof src) {
return ref;
} else if (typeof ref === 'object') {
const out = {};
Object.keys(ref).forEach((key) =>out[key] = merge(ref[key], src[key]));
return out;
} else {
return src;
}
if (typeof ref !== typeof src) {
return ref;
} else if (typeof ref === 'object') {
const out = {};
Object.keys(ref).forEach((key) => out[key] = merge(ref[key], src[key]));
return out;
} else {
return src;
}
};
module.exports = () => {
try {
let configData = fs.readFileSync('config.json', {encoding:'UTF-8'});
let config = JSON.parse(configData);
return merge(refConfig, config);
} catch (error) {
console.error('Failed to load config.json : '+error);
return refConfig;
}
try {
let configData = fs.readFileSync('config.json', {encoding: 'UTF-8'});
let config = JSON.parse(configData);
return merge(refConfig, config);
} catch (error) {
console.error('Failed to load config.json : ' + error);
return refConfig;
}
};