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.2 to 0.2.3

11

lib/convict.js

@@ -41,2 +41,8 @@ /*

},
ipv4: function(x) {
check(x, 'must be an IPv4 address').isIPv4();
},
ipv6: function(x) {
check(x, 'must be an IPv6 address').isIPv6();
},
duration: function(x) {

@@ -49,2 +55,4 @@ check(x, 'must be a positive integer').isInt().min(0);

};
// alias
types.integer = types.int;

@@ -127,3 +135,3 @@ var converters = {};

// store declared type
if (!format in types) {
if (!types[format]) {
throw new Error("'" + fullName + "' uses an unknown format type: " + format);

@@ -250,2 +258,3 @@ }

case 'port':
case 'integer':
case 'int': v = parseInt(v, 10); break;

@@ -252,0 +261,0 @@ case 'number': v = parseFloat(v); break;

2

package.json

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

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

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

@@ -45,2 +45,10 @@ const should = require('should');

},
host2: {
format: 'ipv4',
default: '127.0.0.1'
},
host3: {
format: 'ipv6',
default: '::1'
},
port: {

@@ -66,2 +74,6 @@ format: 'port',

},
int2: {
format: 'integer',
default: 42
},
any: {

@@ -83,2 +95,3 @@ format: '*',

});
});

@@ -105,2 +118,13 @@

});
it('should throw with unknown format', function() {
(function() {
var conf2 = convict({
foo: {
format: 'unknown',
default: 'bar'
}
});
}).should.throw();
});
});
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