schema-llama
Advanced tools
Comparing version 0.0.3-0 to 0.0.3-1
{ | ||
"name": "schema-llama", | ||
"version": "0.0.3-0", | ||
"version": "0.0.3-1", | ||
"description": "A more purely javascript es6 class generator. Takes the work out of validation, type checking, and more.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -65,3 +65,6 @@ import { TypeError, ValidationError, Error } from './errors'; | ||
} | ||
if(!Primitive && value.constructor !== schemaItem) { | ||
if(!Primitive && !schemaItem.prototype && value.constructor !== schemaItem) { | ||
value = schemaItem(value); | ||
} | ||
if(!Primitive && schemaItem.prototype && value.constructor !== schemaItem) { | ||
throw error(value, schemaItem, key); | ||
@@ -68,0 +71,0 @@ } |
15617
177