config-object
Advanced tools
Comparing version 0.2.0 to 0.3.0
@@ -20,3 +20,3 @@ (function() { | ||
ConfigPrototype.prototype.load = function(filename, options) { | ||
var cfg, f, format, _i, _len, _ref; | ||
var cfg, f, format, point, _i, _len, _ref; | ||
if (options == null) { | ||
@@ -71,3 +71,12 @@ options = {}; | ||
})(); | ||
_(this).merge(cfg); | ||
point = this; | ||
if (options.at) { | ||
if (!this.get(options.at)) { | ||
this.set(options.at, {}); | ||
} | ||
point = this.get(options.at, { | ||
clone: false | ||
}); | ||
} | ||
_(point).merge(cfg); | ||
return this; | ||
@@ -139,3 +148,4 @@ }; | ||
_.defaults(options, { | ||
"throw": false | ||
"throw": false, | ||
clone: true | ||
}); | ||
@@ -166,3 +176,7 @@ data = this; | ||
} | ||
return _.cloneDeep(data); | ||
if (options.clone) { | ||
return _.cloneDeep(data); | ||
} else { | ||
return data; | ||
} | ||
}; | ||
@@ -169,0 +183,0 @@ |
{ | ||
"name": "config-object", | ||
"version": "0.2.0", | ||
"version": "0.3.0", | ||
"description": "Configuration as a pure JS object, with helpers :)", | ||
"main": "lib/index.js", | ||
"scripts": { | ||
"test": "gulp --requre 'coffee-script' test", | ||
"test": "gulp test", | ||
"develop": "gulp watch", | ||
"prepublish": "gulp --requre 'coffee-script' build" | ||
@@ -9,0 +10,0 @@ }, |
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
6696
190