simpl-schema
Advanced tools
Comparing version 1.4.1 to 1.4.2
@@ -1114,2 +1114,3 @@ 'use strict'; | ||
// Make sure the `type`s are OK | ||
var couldBeArray = false; | ||
definition.type.definitions.forEach(function (_ref4) { | ||
@@ -1124,2 +1125,4 @@ var type = _ref4.type; | ||
if (type === Array) couldBeArray = true; | ||
if (SimpleSchema.isSimpleSchema(type)) { | ||
@@ -1135,2 +1138,8 @@ Object.keys(type._schema).forEach(function (subKey) { | ||
// If at least one of the possible types is Array, then make sure we have a | ||
// definition for the array items, too. | ||
if (couldBeArray && !fullSchemaObj.hasOwnProperty(fieldName + '.$')) { | ||
throw new Error('"' + fieldName + '" is Array type but the schema does not include a "' + fieldName + '.$" definition for the array items"'); | ||
} | ||
// defaultValue -> autoValue | ||
@@ -1137,0 +1146,0 @@ // We support defaultValue shortcut by converting it immediately into an |
{ | ||
"name": "simpl-schema", | ||
"version": "1.4.1", | ||
"version": "1.4.2", | ||
"description": "A schema validation package that supports direct validation of MongoDB update modifier objects.", | ||
@@ -5,0 +5,0 @@ "author": "Eric Dobbertin <aldeed@gmail.com>", |
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
120319
2684