Comparing version 0.1.10 to 0.1.11
@@ -29,3 +29,3 @@ 'use strict'; | ||
case 'object': | ||
joischema = joi.object(resolveproperties(current)); | ||
joischema = joiobject(current); | ||
break; | ||
@@ -82,2 +82,11 @@ case 'string': | ||
function joiobject(current) { | ||
var joischema = joi.object(resolveproperties(current)); | ||
thing.isNumber(current.minProperties) && (joischema = joischema.min(current.minProperties)); | ||
thing.isNumber(current.maxProperties) && (joischema = joischema.max(current.maxProperties)); | ||
return joischema; | ||
} | ||
function joiarray(current) { | ||
@@ -96,2 +105,6 @@ var joischema = joi.array(); | ||
if (current.uniqueItems) { | ||
joischema = joischema.unique(); | ||
} | ||
return joischema; | ||
@@ -98,0 +111,0 @@ } |
{ | ||
"name": "enjoi", | ||
"version": "0.1.10", | ||
"version": "0.1.11", | ||
"description": "Converts json-schema to Joi schema for validation.", | ||
@@ -33,3 +33,3 @@ "main": "lib/enjoi.js", | ||
"core-util-is": "^1.0.1", | ||
"joi": "^4.6.2" | ||
"joi": "^4.7.0" | ||
}, | ||
@@ -36,0 +36,0 @@ "devDependencies": { |
@@ -73,4 +73,9 @@ [![Build Status](https://travis-ci.org/tlivings/enjoi.png)](https://travis-ci.org/tlivings/enjoi) [![NPM version](https://badge.fury.io/js/enjoi.png)](http://badge.fury.io/js/enjoi) | ||
### Running Benchmarks | ||
### Performance | ||
Joi's validation is very fast. `enjoi` is meant to be used to prepare a schema in advance of | ||
validation; not alongside validation. | ||
You can run a benchmark against `tv4` by running the following command. | ||
```shell | ||
@@ -77,0 +82,0 @@ $ npm run bench |
9386
104
87
Updatedjoi@^4.7.0