config 1.29.4 → 1.30.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/History.md +5 -0
- package/README.md +1 -1
- package/lib/config.js +12 -10
- package/package.json +1 -1
package/History.md
CHANGED
package/README.md
CHANGED
|
@@ -162,8 +162,8 @@ Contributors
|
|
|
162
162
|
<td><img src=https://avatars2.githubusercontent.com/u/54934?v=4><a href="https://github.com/wmertens">wmertens</a></td>
|
|
163
163
|
<td><img src=https://avatars3.githubusercontent.com/u/2842176?v=4><a href="https://github.com/XadillaX">XadillaX</a></td>
|
|
164
164
|
<td><img src=https://avatars1.githubusercontent.com/u/4425455?v=4><a href="https://github.com/ncuillery">ncuillery</a></td>
|
|
165
|
+
<td><img src=https://avatars0.githubusercontent.com/u/2015295?v=4><a href="https://github.com/patrickpilch">patrickpilch</a></td>
|
|
165
166
|
<td><img src=https://avatars1.githubusercontent.com/u/618330?v=4><a href="https://github.com/adityabansod">adityabansod</a></td>
|
|
166
|
-
<td><img src=https://avatars3.githubusercontent.com/u/270632?v=4><a href="https://github.com/thetalecrafter">thetalecrafter</a></td>
|
|
167
167
|
</tr></table>
|
|
168
168
|
|
|
169
169
|
License
|
package/lib/config.js
CHANGED
|
@@ -186,13 +186,6 @@ Config.prototype.get = function(property) {
|
|
|
186
186
|
if(property === null || property === undefined){
|
|
187
187
|
throw new Error("Calling config.get with null or undefined argument");
|
|
188
188
|
}
|
|
189
|
-
var t = this,
|
|
190
|
-
value = getImpl(t, property);
|
|
191
|
-
|
|
192
|
-
// Produce an exception if the property doesn't exist
|
|
193
|
-
if (value === undefined) {
|
|
194
|
-
throw new Error('Configuration property "' + property + '" is not defined');
|
|
195
|
-
}
|
|
196
189
|
|
|
197
190
|
// Make configurations immutable after first get (unless disabled)
|
|
198
191
|
if (checkMutability) {
|
|
@@ -201,9 +194,12 @@ Config.prototype.get = function(property) {
|
|
|
201
194
|
}
|
|
202
195
|
checkMutability = false;
|
|
203
196
|
}
|
|
197
|
+
var t = this,
|
|
198
|
+
value = getImpl(t, property);
|
|
204
199
|
|
|
205
|
-
if
|
|
206
|
-
|
|
200
|
+
// Produce an exception if the property doesn't exist
|
|
201
|
+
if (value === undefined) {
|
|
202
|
+
throw new Error('Configuration property "' + property + '" is not defined');
|
|
207
203
|
}
|
|
208
204
|
|
|
209
205
|
// Return the value
|
|
@@ -552,7 +548,13 @@ util.makeImmutable = function(object, property, value) {
|
|
|
552
548
|
var propertyName = properties[i],
|
|
553
549
|
value = object[propertyName];
|
|
554
550
|
|
|
555
|
-
if (
|
|
551
|
+
if (value instanceof RawConfig) {
|
|
552
|
+
Object.defineProperty(object, propertyName, {
|
|
553
|
+
value: value.resolve(),
|
|
554
|
+
writable: false,
|
|
555
|
+
configurable: false
|
|
556
|
+
});
|
|
557
|
+
} else {
|
|
556
558
|
Object.defineProperty(object, propertyName, {
|
|
557
559
|
value: value,
|
|
558
560
|
writable : false,
|