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.4.0 to 1.0.0

AUTHORS

11

lib/types/object.js

@@ -35,6 +35,11 @@ // Load modules

internals.ObjectType.prototype.convert = function (value) {
if (typeof value === 'object' || typeof value === 'undefined') {
return value;
}
try {
return (typeof value === 'object' || typeof value === 'undefined') ? value : JSON.parse(value);
return JSON.parse(value);
}
catch(err) {
catch (err) {
return value;

@@ -113,3 +118,3 @@ }

var unprocessedKeys = Object.keys(unprocessedObject);
for (var i = 0, il = unprocessedKeys.length; i < il; ++i) {
for (i = 0, il = unprocessedKeys.length; i < il; ++i) {
var unprocessedKey = unprocessedKeys[i];

@@ -116,0 +121,0 @@

{
"name": "joi",
"description": "Object schema validation",
"version": "0.4.0",
"author": "Van Nguyen <the.gol.effect@gmail.com>",
"contributors": [
"Eran Hammer <eran@hueniverse.com> (http://hueniverse.com)",
"Wyatt Preul <wpreul@gmail.com>"
],
"version": "1.0.0",
"repository": "git://github.com/spumko/joi",

@@ -11,0 +6,0 @@ "main": "index",

@@ -148,2 +148,3 @@ // Load modules

expect(Joi.validate('test@test.com', T.String().email())).to.be.null;
expect(Joi.validate({ param: 'item'}, T.Object({ param: T.String().required() }, true))).to.be.null;

@@ -155,3 +156,3 @@ done();

Joi.settings.saveConversions = true;
var config = T.Object({

@@ -164,3 +165,3 @@ a: T.String()

Joi.settings.saveConversions = false;
done();

@@ -171,3 +172,3 @@ });

Joi.settings.saveConversions = true;
var config = T.Object({

@@ -179,3 +180,3 @@ a: T.String()

var validated = { a: 'okay' };
expect(Joi.validate(validated, config)).to.be.null;

@@ -185,3 +186,3 @@ expect(validated).to.deep.equal(original);

Joi.settings.saveConversions = false;
done();

@@ -188,0 +189,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