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 CHANGED
@@ -1,3 +1,8 @@
1
+ 1.30.0 / 2018-02-26
2
+ ===================
3
+
4
+ * Support for nested raw() in javascript configurations - patrickpilch
5
+
1
6
  1.29.4 / 2018-02-03
2
7
  ===================
3
8
 
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 (value instanceof RawConfig) {
206
- value = value.resolve();
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 (!(value instanceof RawConfig)) {
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,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "config",
3
- "version": "1.29.4",
3
+ "version": "1.30.0",
4
4
  "main": "./lib/config.js",
5
5
  "description": "Configuration control for production node deployments",
6
6
  "author": "Loren West <open_source@lorenwest.com>",