We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c75e9f5 commit 8d2331cCopy full SHA for 8d2331c
lib/config/defaults.js
@@ -143,10 +143,10 @@ function commit() {
143
*/
144
function readFile(filePath, field) {
145
if (filePath && fs.existsSync(filePath)) {
146
- var data = fs.readFileSync(filePath);
+ var data = fs.readFileSync(filePath).toString();
147
try {
148
var json = JSON.parse(data)
149
- return field ? (json[field] || {}) : field;
+ return field ? (json[field] || {}) : json;
150
} catch(error) {
151
throw new Error('Unparsable json file: ' + filePath);
152
}
0 commit comments