config 3.3.6 → 3.3.7

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,9 @@
1
+ 3.3.7 / 2022-01-11
2
+ ==================
3
+
4
+ * No new changes. 3.3.6 was not published to NPM in versioning mix-up.
5
+ * Release notes are moving to Github Releas page going forward.
6
+
1
7
  3.3.6 / 2021-03-08
2
8
  ==================
3
9
 
package/lib/config.js CHANGED
@@ -1084,12 +1084,12 @@ util.substituteDeep = function (substitutionMap, variables) {
1084
1084
  for (var prop in map) {
1085
1085
  var value = map[prop];
1086
1086
  if (typeof(value) === 'string') { // We found a leaf variable name
1087
- if (vars[value] !== undefined) { // if the vars provide a value set the value in the result map
1087
+ if (vars[value] !== undefined && vars[value] !== '') { // if the vars provide a value set the value in the result map
1088
1088
  util.setPath(result, pathTo.concat(prop), vars[value]);
1089
1089
  }
1090
1090
  }
1091
1091
  else if (util.isObject(value)) { // work on the subtree, giving it a clone of the pathTo
1092
- if ('__name' in value && '__format' in value && vars[value.__name] !== undefined) {
1092
+ if ('__name' in value && '__format' in value && vars[value.__name] !== undefined && vars[value.__name] !== '') {
1093
1093
  try {
1094
1094
  var parsedValue = util.parseString(vars[value.__name], value.__format);
1095
1095
  } catch(err) {
package/package.json CHANGED
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "name": "config",
3
- "version": "3.3.6",
3
+ "version": "3.3.7",
4
4
  "main": "./lib/config.js",
5
5
  "description": "Configuration control for production node deployments",
6
6
  "author": "Loren West <open_source@lorenwest.com>",
7
- "homepage": "http://lorenwest.github.com/node-config",
7
+ "homepage": "http://github.com/lorenwest/node-config.git",
8
8
  "publishConfig": {
9
9
  "registry": "https://registry.npmjs.org/"
10
10
  },
package/parser.js CHANGED
@@ -55,6 +55,7 @@ Parser.tsParser = function(filename, content) {
55
55
  if (!require.extensions['.ts']) {
56
56
  require(TS_DEP).register({
57
57
  lazy: true,
58
+ transpileOnly: true,
58
59
  compilerOptions: {
59
60
  allowJs: true,
60
61
  }
@@ -136,7 +137,10 @@ Parser.yamlParser = function(filename, content) {
136
137
  // The yaml library doesn't like strings that have newlines but don't
137
138
  // end in a newline: https://github.com/visionmedia/js-yaml/issues/issue/13
138
139
  content += '\n';
139
- return VisionmediaYaml.eval(Parser.stripYamlComments(content));
140
+ if (typeof VisionmediaYaml.eval === 'function') {
141
+ return VisionmediaYaml.eval(Parser.stripYamlComments(content));
142
+ }
143
+ return VisionmediaYaml.parse(Parser.stripYamlComments(content));
140
144
  }
141
145
  else {
142
146
  console.error('No YAML parser loaded. Suggest adding js-yaml dependency to your package.json file.')