Comparing version 2.2.0 to 2.2.1
@@ -0,2 +1,5 @@ | ||
### v2.2.1 | ||
* Add default value (#30). | ||
### v2.2.0 | ||
@@ -3,0 +6,0 @@ |
@@ -83,2 +83,7 @@ 'use strict'; | ||
let joischema; | ||
const typeDefinitionMap = { | ||
description: 'description', | ||
title: 'label', | ||
default: 'default' | ||
}; | ||
@@ -110,8 +115,7 @@ switch (current.type) { | ||
if (current.description) { | ||
joischema = joischema.description(current.description); | ||
} | ||
if (current.title) { | ||
joischema = joischema.label(current.title); | ||
} | ||
Object.keys(typeDefinitionMap).forEach(function (key) { | ||
if (current[key]) { | ||
joischema = joischema[typeDefinitionMap[key]](current[key]); | ||
} | ||
}); | ||
@@ -236,3 +240,3 @@ return joischema; | ||
if (Thing.isUndefined(current.minLength)) { | ||
current.minLength = 0; | ||
current.minLength = 0; | ||
} | ||
@@ -239,0 +243,0 @@ |
{ | ||
"name": "enjoi", | ||
"version": "2.2.0", | ||
"version": "2.2.1", | ||
"description": "Converts json-schema to Joi schema for validation.", | ||
@@ -5,0 +5,0 @@ "main": "lib/enjoi.js", |
15788
239