@interweave/interweave
Advanced tools
Comparing version 0.0.3 to 0.0.4
@@ -15,3 +15,3 @@ "use strict"; | ||
schema: { | ||
// type: "object", | ||
type: "object", | ||
is_array: true, | ||
@@ -22,3 +22,3 @@ object_schema: { | ||
schema: { | ||
type: "number", | ||
// type: "number", | ||
}, | ||
@@ -25,0 +25,0 @@ interface: { |
@@ -303,3 +303,3 @@ "use strict"; | ||
const ensureFieldSet = (fieldName, value, why) => fieldMustBeSet(key, fieldName, value, why); | ||
ensureFieldSet("schema.type", schema === null || schema === void 0 ? void 0 : schema.type, "; field is required"); | ||
ensureFieldSet("schema.type", schema === null || schema === void 0 ? void 0 : schema.type, "- field is required"); | ||
if (!schema.is_optional) { | ||
@@ -329,2 +329,6 @@ const reason = "if schema.is_optional is false"; | ||
if (schema.type === "object") { | ||
// Check recursive fields inside the nested Schema | ||
if (schema.object_schema) { | ||
validateSchema(schema.object_schema); | ||
} | ||
const reason = "if schema.type is number"; | ||
@@ -331,0 +335,0 @@ ensureFieldNotSet("schema.enum", schema === null || schema === void 0 ? void 0 : schema.enum, reason); |
{ | ||
"name": "@interweave/interweave", | ||
"version": "0.0.3", | ||
"version": "0.0.4", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
@@ -447,3 +447,3 @@ import { type Schema, type KeyConfiguration } from "./interfaces"; | ||
ensureFieldSet("schema.type", schema?.type, "; field is required"); | ||
ensureFieldSet("schema.type", schema?.type, "- field is required"); | ||
@@ -501,2 +501,6 @@ if (!schema.is_optional) { | ||
if (schema.type === "object") { | ||
// Check recursive fields inside the nested Schema | ||
if (schema.object_schema) { | ||
validateSchema(schema.object_schema); | ||
} | ||
const reason = "if schema.type is number"; | ||
@@ -503,0 +507,0 @@ ensureFieldNotSet("schema.enum", schema?.enum, reason); |
68953
1977