config 3.3.11 → 3.3.12

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/lib/config.js CHANGED
@@ -7,7 +7,6 @@
7
7
  const DeferredConfig = require('../defer').DeferredConfig;
8
8
  const RawConfig = require('../raw').RawConfig;
9
9
  let Parser = require('../parser');
10
- const Utils = require('util');
11
10
  const Path = require('path');
12
11
  const FileSystem = require('fs');
13
12
 
@@ -1003,12 +1002,12 @@ util.cloneDeep = function cloneDeep(parent, depth, circular, prototype) {
1003
1002
  return parent;
1004
1003
  }
1005
1004
 
1006
- if (Utils.isArray(parent)) {
1005
+ if (Array.isArray(parent)) {
1007
1006
  child = [];
1008
- } else if (Utils.isRegExp(parent)) {
1007
+ } else if (parent instanceof RegExp) {
1009
1008
  child = new RegExp(parent.source, util.getRegExpFlags(parent));
1010
1009
  if (parent.lastIndex) child.lastIndex = parent.lastIndex;
1011
- } else if (Utils.isDate(parent)) {
1010
+ } else if (parent instanceof Date) {
1012
1011
  child = new Date(parent.getTime());
1013
1012
  } else if (useBuffer && Buffer.isBuffer(parent)) {
1014
1013
  child = Buffer.alloc(parent.length);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "config",
3
- "version": "3.3.11",
3
+ "version": "3.3.12",
4
4
  "main": "./lib/config.js",
5
5
  "description": "Configuration control for production node deployments",
6
6
  "author": "Loren West <open_source@lorenwest.com>",
package/parser.js CHANGED
@@ -1,5 +1,4 @@
1
1
  // External libraries are lazy-loaded only if these file types exist.
2
- const util = require("util");
3
2
 
4
3
  // webpack can't solve dynamic module
5
4
  // @see https://github.com/node-config/node-config/issues/755
@@ -61,7 +60,7 @@ Parser.xmlParser = function(filename, content) {
61
60
  Parser.jsParser = function(filename, content) {
62
61
  var configObject = require(filename);
63
62
 
64
- if (configObject.__esModule && util.isObject(configObject.default)) {
63
+ if (configObject.__esModule && isObject(configObject.default)) {
65
64
  return configObject.default
66
65
  }
67
66
  return configObject;
@@ -366,3 +365,7 @@ Parser.setFilesOrder = function(name, newIndex) {
366
365
  }
367
366
  return order;
368
367
  };
368
+
369
+ function isObject(arg) {
370
+ return (arg !== null) && (typeof arg === 'object');
371
+ }