Socket
Socket
Sign inDemoInstall

joi

Package Overview
Dependencies
Maintainers
3
Versions
238
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

joi - npm Package Compare versions

Comparing version 0.3.2 to 0.3.3

4

lib/index.js

@@ -70,3 +70,3 @@ // Load modules

if (converted && keyConfig[i].validate(converted.value, key, object, errors, key)) {
if (converted && keyConfig[i].validate(converted.value, object, key, errors, key)) {
errors._values = errors._values.filter(errorFilter);

@@ -82,3 +82,3 @@ return true;

return converted && keyConfig.validate(converted.value, key, object, errors, key);
return converted && keyConfig.validate(converted.value, object, key, errors, key);
};

@@ -85,0 +85,0 @@

@@ -350,3 +350,3 @@ // Load modules

internals.BaseType.prototype.validate = function (value, key, obj, errors, keyPath) {
internals.BaseType.prototype.validate = function (value, obj, key, errors, keyPath) {

@@ -353,0 +353,0 @@ var status = true;

@@ -88,3 +88,3 @@ // Load modules

if (typeof itemConfig.validate === 'function' &&
itemConfig.validate(value, key, itemConfig, errors, keyPath) === false) {
itemConfig.validate(value, obj, key, errors, keyPath) === false) {

@@ -91,0 +91,0 @@ return false;

{
"name": "joi",
"description": "Object schema validation",
"version": "0.3.2",
"version": "0.3.3",
"author": "Van Nguyen <the.gol.effect@gmail.com>",

@@ -6,0 +6,0 @@ "contributors": [

@@ -188,3 +188,12 @@ // Load modules

T.String().nullOk()
]
],
cache: T.Object({
mode: T.String().valid(['server+client', 'client+server', 'client', 'server']),
segment: T.String(),
privacy: T.String().valid('default', 'public', 'private'),
expiresIn: T.Number().xor('expiresAt'),
expiresAt: T.String(),
staleIn: T.Number().with('staleTimeout'),
staleTimeout: T.Number().with('staleIn')
}).nullOk()
};

@@ -194,2 +203,3 @@

expect(Joi.validate({ auth: { mode: 'required', payload: 'required' }, payload: 'raw' }, config)).to.be.null;
expect(Joi.validate({ handler: internals.item, cache: { expiresIn: 20000, staleIn: 10000, staleTimeout: 500 } }, config)).to.be.null;
done();

@@ -196,0 +206,0 @@ });

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