Skip to content

Commit

Permalink
make it possible to use other formats than json in common.loadFiles a…
Browse files Browse the repository at this point in the history
…nd common.loadFilesSync
  • Loading branch information
tellnes committed Sep 16, 2012
1 parent f9b24f1 commit 8e987b8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/nconf/common.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ common.loadFiles = function (files, callback) {
});
}

async.map(files, parseFile, function (err, objs) {
async.map(options.files, parseFile, function (err, objs) {
return err ? callback(err) : callback(null, common.merge(objs));
});
};
Expand All @@ -80,7 +80,7 @@ common.loadFilesSync = function (files) {
var options = Array.isArray(files) ? { files: files } : files;
options.format = options.format || formats.json;

return common.merge(files.map(function (file) {
return common.merge(options.files.map(function (file) {
return options.format.parse(fs.readFileSync(file, 'utf8'));
}));
};
Expand Down

0 comments on commit 8e987b8

Please sign in to comment.