Comparing version 0.0.7 to 0.0.8
15
etc.js
@@ -26,14 +26,7 @@ var util = require('util'); | ||
var conf = this.deepSnapshot; | ||
var parts = key.split(this.delim); | ||
if (typeof key === 'undefined') return conf; | ||
parts.forEach(function(part) { | ||
if (conf[part]) { | ||
conf = conf[part]; | ||
} | ||
else { | ||
return undefined; | ||
} | ||
}); | ||
return conf; | ||
return key.split(this.delim).reduce(function(prev, part) { | ||
return typeof prev[part] !== 'undefined' ? prev[part] : undefined; | ||
}, conf); | ||
}; | ||
@@ -40,0 +33,0 @@ |
{ | ||
"name": "etc", | ||
"version": "0.0.7", | ||
"version": "0.0.8", | ||
"description": "Configuration loader for node.js applications", | ||
@@ -5,0 +5,0 @@ "main": "etc.js", |
@@ -52,2 +52,6 @@ var etc = require('../'), | ||
it('made-up key returns undefined', function() { | ||
conf.set('foo', 'bar'); | ||
assert.strictEqual(conf.get('blah'), undefined); | ||
}); | ||
}); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
13283
219