@rjsf/validator-ajv8
Advanced tools
Comparing version 5.21.0 to 5.21.1
@@ -272,2 +272,3 @@ "use strict"; | ||
var import_get2 = __toESM(require("lodash/get")); | ||
var import_isEqual = __toESM(require("lodash/isEqual")); | ||
var import_utils4 = require("@rjsf/utils"); | ||
@@ -311,5 +312,5 @@ var AJV8PrecompiledValidator = class { | ||
ensureSameRootSchema(schema, formData) { | ||
if (!(0, import_utils4.deepEquals)(schema, this.rootSchema)) { | ||
if (!(0, import_isEqual.default)(schema, this.rootSchema)) { | ||
const resolvedRootSchema = (0, import_utils4.retrieveSchema)(this, this.rootSchema, this.rootSchema, formData); | ||
if (!(0, import_utils4.deepEquals)(schema, resolvedRootSchema)) { | ||
if (!(0, import_isEqual.default)(schema, resolvedRootSchema)) { | ||
throw new Error( | ||
@@ -316,0 +317,0 @@ "The schema associated with the precompiled validator differs from the rootSchema provided for validation" |
@@ -249,9 +249,9 @@ // src/validator.ts | ||
import get2 from "lodash/get"; | ||
import isEqual from "lodash/isEqual"; | ||
import { | ||
deepEquals as deepEquals2, | ||
hashForSchema as hashForSchema2, | ||
ID_KEY as ID_KEY2, | ||
JUNK_OPTION_ID, | ||
retrieveSchema, | ||
toErrorList as toErrorList2 | ||
toErrorList as toErrorList2, | ||
retrieveSchema | ||
} from "@rjsf/utils"; | ||
@@ -295,5 +295,5 @@ var AJV8PrecompiledValidator = class { | ||
ensureSameRootSchema(schema, formData) { | ||
if (!deepEquals2(schema, this.rootSchema)) { | ||
if (!isEqual(schema, this.rootSchema)) { | ||
const resolvedRootSchema = retrieveSchema(this, this.rootSchema, this.rootSchema, formData); | ||
if (!deepEquals2(schema, resolvedRootSchema)) { | ||
if (!isEqual(schema, resolvedRootSchema)) { | ||
throw new Error( | ||
@@ -300,0 +300,0 @@ "The schema associated with the precompiled validator differs from the rootSchema provided for validation" |
(function (global, factory) { | ||
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@rjsf/utils'), require('ajv'), require('ajv-formats'), require('lodash/isObject'), require('lodash/get')) : | ||
typeof define === 'function' && define.amd ? define(['exports', '@rjsf/utils', 'ajv', 'ajv-formats', 'lodash/isObject', 'lodash/get'], factory) : | ||
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global["@rjsf/validator-ajv8"] = {}, global.utils, global.Ajv, global.addFormats, global.isObject, global.get)); | ||
})(this, (function (exports, utils, Ajv, addFormats, isObject, get) { 'use strict'; | ||
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@rjsf/utils'), require('ajv'), require('ajv-formats'), require('lodash/isObject'), require('lodash/get'), require('lodash/isEqual')) : | ||
typeof define === 'function' && define.amd ? define(['exports', '@rjsf/utils', 'ajv', 'ajv-formats', 'lodash/isObject', 'lodash/get', 'lodash/isEqual'], factory) : | ||
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global["@rjsf/validator-ajv8"] = {}, global.utils, global.Ajv, global.addFormats, global.isObject, global.get, global.isEqual)); | ||
})(this, (function (exports, utils, Ajv, addFormats, isObject, get, isEqual) { 'use strict'; | ||
@@ -263,5 +263,5 @@ // src/validator.ts | ||
ensureSameRootSchema(schema, formData) { | ||
if (!utils.deepEquals(schema, this.rootSchema)) { | ||
if (!isEqual(schema, this.rootSchema)) { | ||
const resolvedRootSchema = utils.retrieveSchema(this, this.rootSchema, this.rootSchema, formData); | ||
if (!utils.deepEquals(schema, resolvedRootSchema)) { | ||
if (!isEqual(schema, resolvedRootSchema)) { | ||
throw new Error( | ||
@@ -268,0 +268,0 @@ "The schema associated with the precompiled validator differs from the rootSchema provided for validation" |
import get from 'lodash/get'; | ||
import { deepEquals, hashForSchema, ID_KEY, JUNK_OPTION_ID, retrieveSchema, toErrorList, } from '@rjsf/utils'; | ||
import isEqual from 'lodash/isEqual'; | ||
import { hashForSchema, ID_KEY, JUNK_OPTION_ID, toErrorList, retrieveSchema, } from '@rjsf/utils'; | ||
import processRawValidationErrors from './processRawValidationErrors'; | ||
@@ -44,6 +45,6 @@ /** `ValidatorType` implementation that uses an AJV 8 precompiled validator as created by the | ||
ensureSameRootSchema(schema, formData) { | ||
if (!deepEquals(schema, this.rootSchema)) { | ||
if (!isEqual(schema, this.rootSchema)) { | ||
// Resolve the root schema with the passed in form data since that may affect the resolution | ||
const resolvedRootSchema = retrieveSchema(this, this.rootSchema, this.rootSchema, formData); | ||
if (!deepEquals(schema, resolvedRootSchema)) { | ||
if (!isEqual(schema, resolvedRootSchema)) { | ||
throw new Error('The schema associated with the precompiled validator differs from the rootSchema provided for validation'); | ||
@@ -50,0 +51,0 @@ } |
{ | ||
"name": "@rjsf/validator-ajv8", | ||
"version": "5.21.0", | ||
"version": "5.21.1", | ||
"main": "dist/index.js", | ||
@@ -51,3 +51,3 @@ "module": "lib/index.js", | ||
"@babel/preset-typescript": "^7.23.3", | ||
"@rjsf/utils": "^5.21.0", | ||
"@rjsf/utils": "^5.21.1", | ||
"@types/jest": "^29.5.12", | ||
@@ -85,3 +85,3 @@ "@types/json-schema": "^7.0.15", | ||
"license": "Apache-2.0", | ||
"gitHead": "76f66b3a397af9ea3877dc94e4ff22a097d089f6" | ||
"gitHead": "33d9bf5f322a13e5a3e2598f89d1452576393422" | ||
} |
import { ErrorObject } from 'ajv'; | ||
import get from 'lodash/get'; | ||
import isEqual from 'lodash/isEqual'; | ||
import { | ||
CustomValidator, | ||
deepEquals, | ||
ErrorSchema, | ||
@@ -12,3 +12,2 @@ ErrorTransformer, | ||
JUNK_OPTION_ID, | ||
retrieveSchema, | ||
RJSFSchema, | ||
@@ -20,2 +19,3 @@ StrictRJSFSchema, | ||
ValidatorType, | ||
retrieveSchema, | ||
} from '@rjsf/utils'; | ||
@@ -97,6 +97,6 @@ | ||
ensureSameRootSchema(schema: S, formData?: T) { | ||
if (!deepEquals(schema, this.rootSchema)) { | ||
if (!isEqual(schema, this.rootSchema)) { | ||
// Resolve the root schema with the passed in form data since that may affect the resolution | ||
const resolvedRootSchema = retrieveSchema(this, this.rootSchema, this.rootSchema, formData); | ||
if (!deepEquals(schema, resolvedRootSchema)) { | ||
if (!isEqual(schema, resolvedRootSchema)) { | ||
throw new Error( | ||
@@ -103,0 +103,0 @@ 'The schema associated with the precompiled validator differs from the rootSchema provided for validation' |
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
Sorry, the diff of this file is not supported yet
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
323357
2715