Comparing version 1.4.0 to 1.5.0
@@ -13,2 +13,3 @@ /** | ||
const minimist = require('minimist'); | ||
const cloneDeep = require('lodash/cloneDeep'); | ||
@@ -24,3 +25,3 @@ function assert(assertion, err_msg) { | ||
// - an array of enumerated values, e.g. ["production", "development", "testing"] | ||
// - built-in JavaScript type, i.e. Object, Array, String, Number, Boolean | ||
// - built-in JavaScript type, i.e. Object, Array, String, Number, Boolean, RegExp | ||
// - or if omitted, the Object.prototype.toString.call of the default value | ||
@@ -103,3 +104,4 @@ | ||
'Number': Number, | ||
'Boolean': Boolean | ||
'Boolean': Boolean, | ||
'RegExp': RegExp | ||
}; | ||
@@ -302,2 +304,3 @@ var BUILT_IN_NAMES = Object.keys(BUILT_INS_BY_NAME); | ||
case 'object': v = JSON.parse(v); break; | ||
case 'regexp': v = new RegExp(v); break; | ||
case 'timestamp': v = moment(v).valueOf(); break; | ||
@@ -356,3 +359,3 @@ case 'duration': | ||
getProperties: function() { | ||
return JSON.parse(JSON.stringify(this._instance)); | ||
return cloneDeep(this._instance); | ||
}, | ||
@@ -395,3 +398,3 @@ root: deprecate.function(function() { | ||
return typeof o !== 'undefined' ? | ||
JSON.parse(JSON.stringify(o)) : | ||
cloneDeep(o) : | ||
void 0; | ||
@@ -410,3 +413,3 @@ }, | ||
return typeof o !== 'undefined' ? | ||
JSON.parse(JSON.stringify(o)) : | ||
cloneDeep(o) : | ||
void 0; | ||
@@ -413,0 +416,0 @@ }, |
{ | ||
"name": "convict", | ||
"version": "1.4.0", | ||
"version": "1.5.0", | ||
"dependencies": { | ||
@@ -15,2 +15,7 @@ "depd": { | ||
}, | ||
"lodash": { | ||
"version": "4.16.2", | ||
"from": "lodash@4.16.2", | ||
"resolved": "https://registry.npmjs.org/lodash/-/lodash-4.16.2.tgz" | ||
}, | ||
"minimist": { | ||
@@ -17,0 +22,0 @@ "version": "1.2.0", |
@@ -13,3 +13,3 @@ { | ||
], | ||
"version": "1.4.0", | ||
"version": "1.5.0", | ||
"license": "Apache-2.0", | ||
@@ -47,2 +47,3 @@ "homepage": "https://github.com/mozilla/node-convict", | ||
"json5": "0.5.0", | ||
"lodash": "4.16.2", | ||
"minimist": "1.2.0", | ||
@@ -49,0 +50,0 @@ "moment": "2.12.0", |
@@ -178,3 +178,3 @@ # Node-convict | ||
If `format` is set to one of the built-in JavaScript constructors, `Object`, `Array`, `String`, `Number`, or `Boolean`, validation will use Object.prototype.toString.call to check that the setting is the proper type. | ||
If `format` is set to one of the built-in JavaScript constructors, `Object`, `Array`, `String`, `Number`, `RegExp`, or `Boolean`, validation will use Object.prototype.toString.call to check that the setting is the proper type. | ||
@@ -181,0 +181,0 @@ #### Custom format checking |
Sorry, the diff of this file is not supported yet
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
42735
558
7
+ Addedlodash@4.16.2
+ Addedlodash@4.16.2(transitive)