Socket
Socket
Sign inDemoInstall

joi

Package Overview
Dependencies
Maintainers
4
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 4.6.1 to 4.6.2

6

CONTRIBUTING.md

@@ -5,3 +5,3 @@ # How to contribute

## Logging Issues
All issues should be created using the [new issue form](https://github.com/spumko/joi/issues/new). Clearly describe the issue including steps to reproduce if there are any. Also, make sure to indicate the earliest version that has the issue being reported.
All issues should be created using the [new issue form](https://github.com/hapijs/joi/issues/new). Clearly describe the issue including steps to reproduce if there are any. Also, make sure to indicate the earliest version that has the issue being reported.

@@ -12,5 +12,5 @@ ## Patching Code

* Fork the repository on GitHub.
* Fix the issue ensuring that your code follows the [style guide](https://github.com/spumko/hapi/blob/master/docs/Style.md).
* Fix the issue ensuring that your code follows the [style guide](https://github.com/hapijs/hapi/blob/master/docs/Style.md).
* Add tests for your new code ensuring that you have 100% code coverage (we can help you reach 100% but will not merge without it).
* Run `npm test` to generate a report of test coverage
* [Pull requests](http://help.github.com/send-pull-requests/) should be made to the [master branch](https://github.com/spumko/joi/tree/master).
* [Pull requests](http://help.github.com/send-pull-requests/) should be made to the [master branch](https://github.com/hapijs/joi/tree/master).
// Load modules
var Sys = require('sys');
var Any = require('./any');

@@ -5,0 +4,0 @@ var Cast = require('./cast');

{
"name": "joi",
"description": "Object schema validation",
"version": "4.6.1",
"repository": "git://github.com/spumko/joi",
"version": "4.6.2",
"repository": "git://github.com/hapijs/joi",
"main": "index",

@@ -12,3 +12,3 @@ "keywords": [

"engines": {
"node": ">=0.10.22"
"node": ">=0.10.30"
},

@@ -26,21 +26,8 @@ "dependencies": {

},
"testling": {
"files": "test/*.js",
"browsers": [
"ie/6..latest",
"chrome/22..latest",
"firefox/16..latest",
"safari/latest",
"opera/11.0..latest",
"iphone/6",
"ipad/6",
"android-browser/latest"
]
},
"licenses": [
{
"type": "BSD",
"url": "http://github.com/spumko/joi/raw/master/LICENSE"
"url": "http://github.com/hapijs/joi/raw/master/LICENSE"
}
]
}

@@ -1,3 +0,2 @@

<a href="https://github.com/spumko"><img src="https://raw.github.com/spumko/spumko/master/images/from.png" align="right" /></a>
![joi Logo](https://raw.github.com/spumko/joi/master/images/joi.png)
![joi Logo](https://raw.github.com/hapijs/joi/master/images/joi.png)

@@ -8,9 +7,9 @@ Object schema description language and validator for JavaScript objects.

[![Build Status](https://secure.travis-ci.org/spumko/joi.png)](http://travis-ci.org/spumko/joi)
[![Build Status](https://secure.travis-ci.org/hapijs/joi.png)](http://travis-ci.org/hapijs/joi)
[![Browser Support](https://ci.testling.com/spumko/joi.png)](https://ci.testling.com/spumko/joi)
Lead Maintainer: [Eran Hammer](https://github.com/hueniverse)
## Table of Contents
<img src="https://raw.github.com/spumko/joi/master/images/validation.png" align="right" />
<img src="https://raw.github.com/hapijs/joi/master/images/validation.png" align="right" />
- [Example](#example)

@@ -802,3 +801,3 @@ - [Usage](#usage)

```javascript
var schema = Joi.Object({ a: Joi.any() }).unknown();
var schema = Joi.object({ a: Joi.any() }).unknown();
```

@@ -805,0 +804,0 @@

@@ -131,2 +131,32 @@ // Load modules

});
it('sets value based on condition (outter)', function (done) {
var schema = Joi.object({
a: Joi.boolean(),
b: Joi.boolean().default(false).when('a', { is: true, then: Joi.required(), otherwise: Joi.forbidden() })
});
schema.validate({ a: false }, function (err, value) {
expect(err).to.not.exist;
expect(value.b).to.equal(false);
done();
});
});
it('sets value based on condition (inner)', function (done) {
var schema = Joi.object({
a: Joi.boolean(),
b: Joi.boolean().when('a', { is: true, then: Joi.default(false), otherwise: Joi.forbidden() })
});
schema.validate({ a: true }, function (err, value) {
expect(err).to.not.exist;
expect(value.b).to.equal(false);
done();
});
});
});

@@ -133,0 +163,0 @@

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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