Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More →
Socket
Sign inDemoInstall
Socket

convict

Package Overview
Dependencies
Maintainers
3
Versions
63
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

convict - npm Package Compare versions

Comparing version 0.2.3 to 0.3.0

21

lib/convict.js

@@ -87,3 +87,3 @@ /*

if (typeof o === 'object' && !Array.isArray(o) && typeof o.default === 'undefined') {
if (typeof o === 'object' && !Array.isArray(o) && !('default' in o)) {
props[name] = {

@@ -100,2 +100,3 @@ properties: {},

if (typeof o === 'object') {

@@ -207,3 +208,3 @@ props[name] = o;

} else {
if (!c[name] && typeof p.default !== 'undefined') c[name] = coerce(name, p.default, schema);
if (!c[name] && 'default' in p) c[name] = coerce(name, p.default, schema);
}

@@ -287,3 +288,3 @@ });

get: function(path) {
var o = JSON.parse(JSON.stringify(this._instance));
var o = this._instance;
if (path) {

@@ -293,10 +294,12 @@ var ar = path.split('.');

var k = ar.shift();
if (typeof o[k] !== undefined) o = o[k];
if (o === undefined) break;
if (k in o) {
o = o[k];
} else {
throw new Error("cannot find configuration param '" + path + "'");
}
}
}
if (o === undefined) {
throw new Error("cannot find configuration param '" + path + "'");
}
return o;
return typeof o !== 'undefined' ?
JSON.parse(JSON.stringify(o)) :
void 0;
},

@@ -303,0 +306,0 @@ has: function(path) {

@@ -5,3 +5,3 @@ {

"description": "Unruly configuration management for nodejs",
"version": "0.2.3",
"version": "0.3.0",
"homepage": "https://github.com/lloyd/node-convict",

@@ -8,0 +8,0 @@ "repository": {

@@ -91,2 +91,6 @@ const should = require('should');

},
optional: {
format: '*',
default: undefined
}
}

@@ -127,2 +131,7 @@ });

});
it('should accept undefined as a default', function() {
var val = conf.get('foo.optional');
should.equal(val, undefined);
});
});
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡ī¸ by Socket Inc