Skip to content

Commit

Permalink
Removing debug code, bug fixes.
Browse files Browse the repository at this point in the history
  • Loading branch information
tizzo committed Mar 5, 2015
1 parent 7798c98 commit e160b1e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
9 changes: 5 additions & 4 deletions index.js
Expand Up @@ -150,11 +150,9 @@ Loader.prototype.loadFileOrDirectory = function(path, options, done) {
* Filter the keys of the configuration hash by an array of allowed values.
*/
Loader.prototype.filterKeys = function(keys, config) {
console.log(arguments);
var output = {};
for (i in config) {
if (keys.indexOf(i) !== -1) {
console.log('include', i);
output[i] = config[i];
}
}
Expand All @@ -165,15 +163,18 @@ Loader.prototype.filterKeys = function(keys, config) {
* Load configuration for an individual file.
*/
Loader.prototype.loadFile = function(path, options, done) {
done = done || options;
if (!done) {
done = options;
options = false;
}
var self = this;
fs.exists(path, function(exists) {
if (exists) {
fs.readFile(path, 'utf8', function(error, data) {
/* istanbul ignore if: This error condition is near impossible to test. */
if (error) return self.errorHandler(error, done);
self.parseYaml(data, function(error, config) {
if (options && options.filterKeys === true) {
if (options && options.filterKeys === true && config) {
self.postFilters.push(self.filterKeys.bind(self, Object.keys(config)));
}
done(error, config);
Expand Down
2 changes: 1 addition & 1 deletion package.json
@@ -1,6 +1,6 @@
{
"name": "yaml-config-loader",
"version": "1.1.0",
"version": "1.1.1",
"repository": {
"type" : "git",
"url" : "http://github.com/tizzo/yaml-config-loader.git"
Expand Down

0 comments on commit e160b1e

Please sign in to comment.