Comparing version 2.0.1 to 2.0.2
@@ -0,0 +0,0 @@ # How to contribute |
@@ -0,0 +0,0 @@ { |
@@ -0,0 +0,0 @@ // Load modules |
@@ -61,9 +61,2 @@ // Load modules | ||
internals.Array.prototype.emptyOk = function () { | ||
this._allow([]); | ||
return this; | ||
}; | ||
internals.Array.prototype.includes = function () { | ||
@@ -70,0 +63,0 @@ |
@@ -0,0 +0,0 @@ // Load modules |
@@ -0,0 +0,0 @@ // Load modules |
@@ -0,0 +0,0 @@ // Load modules |
@@ -0,0 +0,0 @@ // Load modules |
@@ -0,0 +0,0 @@ // Load modules |
@@ -0,0 +0,0 @@ // Load modules |
@@ -0,0 +0,0 @@ // Load modules |
@@ -0,0 +0,0 @@ // Load modules |
@@ -0,0 +0,0 @@ // Load modules |
{ | ||
"name": "joi", | ||
"description": "Object schema validation", | ||
"version": "2.0.1", | ||
"version": "2.0.2", | ||
"repository": "git://github.com/spumko/joi", | ||
@@ -6,0 +6,0 @@ "main": "index", |
@@ -1,2 +0,2 @@ | ||
<a href="https://github.com/spumko"><img src="https://raw.github.com/spumko/spumko/master/images/from.png" align="right" /></a> | ||
<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) | ||
@@ -6,3 +6,3 @@ | ||
Current version: **2.x.x** | ||
Current version: **2.0.x** | ||
@@ -24,3 +24,2 @@ [![Build Status](https://secure.travis-ci.org/spumko/joi.png)](http://travis-ci.org/spumko/joi) | ||
- [`any.optional()`](#anyoptional) | ||
- [`any.nullOk()`](#anynullok) | ||
- [`any.with(peer)`](#anywithpeer) | ||
@@ -36,3 +35,2 @@ - [`any.without(peer)`](#anywithoutpeer) | ||
- [`array()`](#array) | ||
- [`array.emptyOk()`](#arrayemptyok) | ||
- [`array.includes(type)`](#arrayincludestype) | ||
@@ -54,3 +52,2 @@ - [`array.excludes(type)`](#arrayexcludestype) | ||
- [`string()`](#string) | ||
- [`string.emptyOk()`](#stringemptyok) | ||
- [`string.insensitive()`](#stringinsensitive) | ||
@@ -238,12 +235,2 @@ - [`string.min(limit)`](#stringminlimit) | ||
#### `any.nullOk()` | ||
Allows `null` as valid value. Note that while `undefined` is a valid value for an optional key, `null` is not and must be explicitly allowed. | ||
```javascript | ||
var schema = { | ||
a: Joi.any().nullOk() | ||
}; | ||
``` | ||
#### `any.with(peer)` | ||
@@ -352,3 +339,2 @@ | ||
- `optional()` | ||
- `nullOk()` | ||
- `with(peer)` | ||
@@ -370,12 +356,2 @@ - `without(peer)` | ||
#### `array.emptyOk()` | ||
Allows the value to be assigned an empty array. | ||
```javascript | ||
var schema = { | ||
a: Joi.array().emptyOk() | ||
}; | ||
``` | ||
#### `array.includes(type)` | ||
@@ -438,3 +414,3 @@ | ||
Generates a schema object that matches a boolean data type (as well as the strings 'true', 'false', 'yes', and 'no'). | ||
Generates a schema object that matches a boolean data type (as well as the strings 'true', 'false', 'yes', and 'no'). Can also be called via `bool()`. | ||
@@ -445,3 +421,3 @@ Supports the same methods of the [`any()`](#any) type. | ||
var boolean = Joi.boolean(); | ||
boolean.nullOk(); | ||
boolean.allow(null); | ||
@@ -494,3 +470,3 @@ var err = any.validate(true); | ||
var func = Joi.func(); | ||
func.nullOk(); | ||
func.allow(null); | ||
@@ -563,3 +539,3 @@ var err = func.validate(function () {}); | ||
Generates a schema object that matches a string data type. | ||
Generates a schema object that matches a string data type. Note that empty strings are not allowed by default and must be enabled with `allow('')`. | ||
@@ -575,12 +551,2 @@ Supports the same methods of the [`any()`](#any) type. | ||
#### `string.emptyOk()` | ||
Allows the value to be assigned an empty string. | ||
```javascript | ||
var schema = { | ||
a: Joi.string().emptyOk() | ||
}; | ||
``` | ||
#### `string.insensitive()` | ||
@@ -587,0 +553,0 @@ |
@@ -0,0 +0,0 @@ // Load modules |
@@ -123,5 +123,5 @@ // Load modules | ||
it('should allow empty arrays with emptyOk', function (done) { | ||
it('allows empty arrays', function (done) { | ||
Validate(Joi.array().emptyOk(), [ | ||
Validate(Joi.array(), [ | ||
[undefined, true], | ||
@@ -128,0 +128,0 @@ [[], true] |
@@ -0,0 +0,0 @@ // Load modules |
@@ -0,0 +0,0 @@ // Load modules |
@@ -0,0 +0,0 @@ // Load modules |
@@ -0,0 +0,0 @@ // Load modules |
@@ -0,0 +0,0 @@ // Load modules |
@@ -0,0 +0,0 @@ // Load modules |
@@ -0,0 +0,0 @@ // Load modules |
@@ -0,0 +0,0 @@ // Load modules |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
287403
3315
623