@contember/schema-utils
Advanced tools
Comparing version 1.1.0-alpha.3 to 1.1.0-alpha.4
@@ -6,3 +6,2 @@ "use strict"; | ||
const ModelValidator_1 = require("./ModelValidator"); | ||
const util_1 = require("util"); | ||
const ValidationValidator_1 = require("./ValidationValidator"); | ||
@@ -20,10 +19,12 @@ const utils_1 = require("../utils"); | ||
const errors = [...aclErrors, ...modelErrors, ...validationErrors]; | ||
if (errors.length === 0 && !(0, util_1.isDeepStrictEqual)(validSchema, schema)) { | ||
if (errors.length === 0) { | ||
const errors = (0, utils_1.deepCompare)(validSchema, schema, []); | ||
let message = 'There is something wrong with a schema validator:'; | ||
for (const err of errors) { | ||
message += '\n\t' + err.path.join('.') + ': ' + err.message; | ||
if (errors.length) { | ||
let message = 'There is something wrong with a schema validator:'; | ||
for (const err of errors) { | ||
message += '\n\t' + err.path.join('.') + ': ' + err.message; | ||
} | ||
message += '\n\nPlease fill a bug report'; | ||
throw new Error(message); | ||
} | ||
message += '\n\nPlease fill a bug report'; | ||
throw new Error(message); | ||
} | ||
@@ -30,0 +31,0 @@ return errors; |
{ | ||
"name": "@contember/schema-utils", | ||
"version": "1.1.0-alpha.3", | ||
"version": "1.1.0-alpha.4", | ||
"license": "Apache-2.0", | ||
@@ -11,3 +11,3 @@ "main": "dist/src/index.js", | ||
"dependencies": { | ||
"@contember/schema": "^1.1.0-alpha.3" | ||
"@contember/schema": "^1.1.0-alpha.4" | ||
}, | ||
@@ -14,0 +14,0 @@ "devDependencies": { |
@@ -23,10 +23,12 @@ import { Schema } from '@contember/schema' | ||
const errors = [...aclErrors, ...modelErrors, ...validationErrors] | ||
if (errors.length === 0 && !isDeepStrictEqual(validSchema, schema)) { | ||
if (errors.length === 0) { | ||
const errors = deepCompare(validSchema, schema, []) | ||
let message = 'There is something wrong with a schema validator:' | ||
for (const err of errors) { | ||
message += '\n\t' + err.path.join('.') + ': ' + err.message | ||
if (errors.length) { | ||
let message = 'There is something wrong with a schema validator:' | ||
for (const err of errors) { | ||
message += '\n\t' + err.path.join('.') + ': ' + err.message | ||
} | ||
message += '\n\nPlease fill a bug report' | ||
throw new Error(message) | ||
} | ||
message += '\n\nPlease fill a bug report' | ||
throw new Error(message) | ||
} | ||
@@ -33,0 +35,0 @@ return errors |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
3863
253406