Socket
Socket
Sign inDemoInstall

@rjsf/validator-ajv8

Package Overview
Dependencies
24
Maintainers
2
Versions
64
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 5.8.1 to 5.8.2

11

dist/index.cjs.development.js

@@ -225,2 +225,3 @@ 'use strict';

try {
var _schemaWithIdRefPrefi;
// add the rootSchema ROOT_SCHEMA_PREFIX as id.

@@ -234,8 +235,10 @@ // then rewrite the schema ref's to point to the rootSchema

var schemaWithIdRefPrefix = utils.withIdRefPrefix(schema);
var schemaId = (_schemaWithIdRefPrefi = schemaWithIdRefPrefix[utils.ID_KEY]) != null ? _schemaWithIdRefPrefi : utils.hashForSchema(schemaWithIdRefPrefix);
var compiledValidator;
if (schemaWithIdRefPrefix[utils.ID_KEY]) {
compiledValidator = this.ajv.getSchema(schemaWithIdRefPrefix[utils.ID_KEY]);
}
compiledValidator = this.ajv.getSchema(schemaId);
if (compiledValidator === undefined) {
compiledValidator = this.ajv.compile(schemaWithIdRefPrefix);
// Add schema by an explicit ID so it can be fetched later
// Fall back to using compile if necessary
// https://ajv.js.org/guide/managing-schemas.html#pre-adding-all-schemas-vs-adding-on-demand
compiledValidator = this.ajv.addSchema(schemaWithIdRefPrefix, schemaId).getSchema(schemaId) || this.ajv.compile(schemaWithIdRefPrefix);
}

@@ -242,0 +245,0 @@ var result = compiledValidator(formData);

@@ -1,2 +0,2 @@

"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var r=require("@rjsf/utils"),e=require("./createAjvInstance-0cd8cfba.js"),t=require("lodash/get"),a=require("lodash/isEqual");function i(r){return r&&"object"==typeof r&&"default"in r?r:{default:r}}require("ajv"),require("ajv-formats"),require("lodash/isObject");var o=i(t),s=i(a),n=["instancePath","keyword","params","schemaPath","parentSchema"];function c(t,a,i,s,c,l,h){var d=a.validationError,u=function(t,a){return void 0===t&&(t=[]),t.map((function(t){var i=t.instancePath,s=t.keyword,c=t.params,l=t.schemaPath,h=t.parentSchema,d=e._objectWithoutPropertiesLoose(t,n).message,u=void 0===d?"":d,v=i.replace(/\//g,"."),m=(v+" "+u).trim();if("missingProperty"in c){var f=c.missingProperty,p=r.getUiOptions(o.default(a,""+(v=v?v+"."+c.missingProperty:c.missingProperty).replace(/^\./,""))).title;if(p)u=u.replace(f,p);else{var E=o.default(h,[r.PROPERTIES_KEY,f,"title"]);E&&(u=u.replace(f,E))}m=u}else{var S=r.getUiOptions(o.default(a,""+v.replace(/^\./,""))).title;if(S)m=("'"+S+"' "+u).trim();else{var g=null==h?void 0:h.title;g&&(m=("'"+g+"' "+u).trim())}}return{name:s,property:v,message:u,params:c,stack:m,schemaPath:l}}))}(a.errors,h);d&&(u=[].concat(u,[{stack:d.message}])),"function"==typeof l&&(u=l(u,h));var v=r.toErrorSchema(u);if(d&&(v=e._extends({},v,{$schema:{__errors:[d.message]}})),"function"!=typeof c)return{errors:u,errorSchema:v};var m=r.getDefaultFormState(t,s,i,s,!0),f=c(m,r.createErrorHandler(m),h),p=r.unwrapErrorHandler(f);return r.validationDataMerge({errors:u,errorSchema:v},p)}var l=function(){function t(r,t){this.ajv=void 0,this.localizer=void 0,this.ajv=e.createAjvInstance(r.additionalMetaSchemas,r.customFormats,r.ajvOptionsOverrides,r.ajvFormatOptions,r.AjvClass),this.localizer=t}var a=t.prototype;return a.toErrorList=function(e,t){return void 0===t&&(t=[]),r.toErrorList(e,t)},a.rawValidation=function(e,t){var a,i,o=void 0;e[r.ID_KEY]&&(a=this.ajv.getSchema(e[r.ID_KEY]));try{void 0===a&&(a=this.ajv.compile(e)),a(t)}catch(r){o=r}return a&&("function"==typeof this.localizer&&this.localizer(a.errors),i=a.errors||void 0,a.errors=null),{errors:i,validationError:o}},a.validateFormData=function(r,e,t,a,i){return c(this,this.rawValidation(e,r),r,e,t,a,i)},a.isValid=function(e,t,a){var i,o=null!=(i=a[r.ID_KEY])?i:r.ROOT_SCHEMA_PREFIX;try{void 0===this.ajv.getSchema(o)&&this.ajv.addSchema(a,o);var s,n=r.withIdRefPrefix(e);return n[r.ID_KEY]&&(s=this.ajv.getSchema(n[r.ID_KEY])),void 0===s&&(s=this.ajv.compile(n)),s(t)}catch(r){return console.warn("Error encountered compiling schema:",r),!1}finally{this.ajv.removeSchema(o)}},t}();function h(r,e){return void 0===r&&(r={}),new l(r,e)}var d=function(){function e(e,t,a){this.rootSchema=void 0,this.resolvedRootSchema=void 0,this.validateFns=void 0,this.mainValidator=void 0,this.localizer=void 0,this.rootSchema=t,this.validateFns=e,this.localizer=a,this.mainValidator=this.getValidator(t),this.resolvedRootSchema=r.retrieveSchema(this,t,t)}var t=e.prototype;return t.getValidator=function(e){var t=o.default(e,r.ID_KEY)||r.hashForSchema(e),a=this.validateFns[t];if(!a)throw new Error('No precompiled validator function was found for the given schema for "'+t+'"');return a},t.toErrorList=function(e,t){return void 0===t&&(t=[]),r.toErrorList(e,t)},t.rawValidation=function(r,e){if(!s.default(r,this.resolvedRootSchema))throw new Error("The schema associated with the precompiled schema differs from the schema provided for validation");this.mainValidator(e),"function"==typeof this.localizer&&this.localizer(this.mainValidator.errors);var t=this.mainValidator.errors||void 0;return this.mainValidator.errors=null,{errors:t}},t.validateFormData=function(r,e,t,a,i){return c(this,this.rawValidation(e,r),r,e,t,a,i)},t.isValid=function(e,t,a){if(!s.default(a,this.rootSchema))throw new Error("The schema associated with the precompiled validator differs from the rootSchema provided for validation");return o.default(e,r.ID_KEY)!==r.JUNK_OPTION_ID&&this.getValidator(e)(t)},e}(),u=h();exports.createPrecompiledValidator=function(r,e,t){return new d(r,e,t)},exports.customizeValidator=h,exports.default=u;
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var r=require("@rjsf/utils"),e=require("./createAjvInstance-0cd8cfba.js"),t=require("lodash/get"),a=require("lodash/isEqual");function i(r){return r&&"object"==typeof r&&"default"in r?r:{default:r}}require("ajv"),require("ajv-formats"),require("lodash/isObject");var o=i(t),s=i(a),n=["instancePath","keyword","params","schemaPath","parentSchema"];function c(t,a,i,s,c,l,h){var d=a.validationError,v=function(t,a){return void 0===t&&(t=[]),t.map((function(t){var i=t.instancePath,s=t.keyword,c=t.params,l=t.schemaPath,h=t.parentSchema,d=e._objectWithoutPropertiesLoose(t,n).message,v=void 0===d?"":d,u=i.replace(/\//g,"."),m=(u+" "+v).trim();if("missingProperty"in c){var f=c.missingProperty,p=r.getUiOptions(o.default(a,""+(u=u?u+"."+c.missingProperty:c.missingProperty).replace(/^\./,""))).title;if(p)v=v.replace(f,p);else{var S=o.default(h,[r.PROPERTIES_KEY,f,"title"]);S&&(v=v.replace(f,S))}m=v}else{var E=r.getUiOptions(o.default(a,""+u.replace(/^\./,""))).title;if(E)m=("'"+E+"' "+v).trim();else{var g=null==h?void 0:h.title;g&&(m=("'"+g+"' "+v).trim())}}return{name:s,property:u,message:v,params:c,stack:m,schemaPath:l}}))}(a.errors,h);d&&(v=[].concat(v,[{stack:d.message}])),"function"==typeof l&&(v=l(v,h));var u=r.toErrorSchema(v);if(d&&(u=e._extends({},u,{$schema:{__errors:[d.message]}})),"function"!=typeof c)return{errors:v,errorSchema:u};var m=r.getDefaultFormState(t,s,i,s,!0),f=c(m,r.createErrorHandler(m),h),p=r.unwrapErrorHandler(f);return r.validationDataMerge({errors:v,errorSchema:u},p)}var l=function(){function t(r,t){this.ajv=void 0,this.localizer=void 0,this.ajv=e.createAjvInstance(r.additionalMetaSchemas,r.customFormats,r.ajvOptionsOverrides,r.ajvFormatOptions,r.AjvClass),this.localizer=t}var a=t.prototype;return a.toErrorList=function(e,t){return void 0===t&&(t=[]),r.toErrorList(e,t)},a.rawValidation=function(e,t){var a,i,o=void 0;e[r.ID_KEY]&&(a=this.ajv.getSchema(e[r.ID_KEY]));try{void 0===a&&(a=this.ajv.compile(e)),a(t)}catch(r){o=r}return a&&("function"==typeof this.localizer&&this.localizer(a.errors),i=a.errors||void 0,a.errors=null),{errors:i,validationError:o}},a.validateFormData=function(r,e,t,a,i){return c(this,this.rawValidation(e,r),r,e,t,a,i)},a.isValid=function(e,t,a){var i,o=null!=(i=a[r.ID_KEY])?i:r.ROOT_SCHEMA_PREFIX;try{var s;void 0===this.ajv.getSchema(o)&&this.ajv.addSchema(a,o);var n,c=r.withIdRefPrefix(e),l=null!=(s=c[r.ID_KEY])?s:r.hashForSchema(c);return void 0===(n=this.ajv.getSchema(l))&&(n=this.ajv.addSchema(c,l).getSchema(l)||this.ajv.compile(c)),n(t)}catch(r){return console.warn("Error encountered compiling schema:",r),!1}finally{this.ajv.removeSchema(o)}},t}();function h(r,e){return void 0===r&&(r={}),new l(r,e)}var d=function(){function e(e,t,a){this.rootSchema=void 0,this.resolvedRootSchema=void 0,this.validateFns=void 0,this.mainValidator=void 0,this.localizer=void 0,this.rootSchema=t,this.validateFns=e,this.localizer=a,this.mainValidator=this.getValidator(t),this.resolvedRootSchema=r.retrieveSchema(this,t,t)}var t=e.prototype;return t.getValidator=function(e){var t=o.default(e,r.ID_KEY)||r.hashForSchema(e),a=this.validateFns[t];if(!a)throw new Error('No precompiled validator function was found for the given schema for "'+t+'"');return a},t.toErrorList=function(e,t){return void 0===t&&(t=[]),r.toErrorList(e,t)},t.rawValidation=function(r,e){if(!s.default(r,this.resolvedRootSchema))throw new Error("The schema associated with the precompiled schema differs from the schema provided for validation");this.mainValidator(e),"function"==typeof this.localizer&&this.localizer(this.mainValidator.errors);var t=this.mainValidator.errors||void 0;return this.mainValidator.errors=null,{errors:t}},t.validateFormData=function(r,e,t,a,i){return c(this,this.rawValidation(e,r),r,e,t,a,i)},t.isValid=function(e,t,a){if(!s.default(a,this.rootSchema))throw new Error("The schema associated with the precompiled validator differs from the rootSchema provided for validation");return o.default(e,r.ID_KEY)!==r.JUNK_OPTION_ID&&this.getValidator(e)(t)},e}(),v=h();exports.createPrecompiledValidator=function(r,e,t){return new d(r,e,t)},exports.customizeValidator=h,exports.default=v;
//# sourceMappingURL=index.cjs.production.min.js.map

@@ -1,2 +0,2 @@

import { ADDITIONAL_PROPERTY_FLAG, RJSF_ADDITONAL_PROPERTIES_FLAG, toErrorSchema, getDefaultFormState, createErrorHandler, unwrapErrorHandler, validationDataMerge, getUiOptions, PROPERTIES_KEY, toErrorList, ID_KEY, withIdRefPrefix, ROOT_SCHEMA_PREFIX, retrieveSchema, hashForSchema, JUNK_OPTION_ID } from '@rjsf/utils';
import { ADDITIONAL_PROPERTY_FLAG, RJSF_ADDITONAL_PROPERTIES_FLAG, toErrorSchema, getDefaultFormState, createErrorHandler, unwrapErrorHandler, validationDataMerge, getUiOptions, PROPERTIES_KEY, toErrorList, ID_KEY, withIdRefPrefix, hashForSchema, ROOT_SCHEMA_PREFIX, retrieveSchema, JUNK_OPTION_ID } from '@rjsf/utils';
import Ajv from 'ajv';

@@ -297,2 +297,3 @@ import addFormats from 'ajv-formats';

try {
var _schemaWithIdRefPrefi;
// add the rootSchema ROOT_SCHEMA_PREFIX as id.

@@ -306,8 +307,10 @@ // then rewrite the schema ref's to point to the rootSchema

var schemaWithIdRefPrefix = withIdRefPrefix(schema);
var schemaId = (_schemaWithIdRefPrefi = schemaWithIdRefPrefix[ID_KEY]) != null ? _schemaWithIdRefPrefi : hashForSchema(schemaWithIdRefPrefix);
var compiledValidator;
if (schemaWithIdRefPrefix[ID_KEY]) {
compiledValidator = this.ajv.getSchema(schemaWithIdRefPrefix[ID_KEY]);
}
compiledValidator = this.ajv.getSchema(schemaId);
if (compiledValidator === undefined) {
compiledValidator = this.ajv.compile(schemaWithIdRefPrefix);
// Add schema by an explicit ID so it can be fetched later
// Fall back to using compile if necessary
// https://ajv.js.org/guide/managing-schemas.html#pre-adding-all-schemas-vs-adding-on-demand
compiledValidator = this.ajv.addSchema(schemaWithIdRefPrefix, schemaId).getSchema(schemaId) || this.ajv.compile(schemaWithIdRefPrefix);
}

@@ -314,0 +317,0 @@ var result = compiledValidator(formData);

@@ -304,2 +304,3 @@ (function (global, factory) {

try {
var _schemaWithIdRefPrefi;
// add the rootSchema ROOT_SCHEMA_PREFIX as id.

@@ -313,8 +314,10 @@ // then rewrite the schema ref's to point to the rootSchema

var schemaWithIdRefPrefix = utils.withIdRefPrefix(schema);
var schemaId = (_schemaWithIdRefPrefi = schemaWithIdRefPrefix[utils.ID_KEY]) != null ? _schemaWithIdRefPrefi : utils.hashForSchema(schemaWithIdRefPrefix);
var compiledValidator;
if (schemaWithIdRefPrefix[utils.ID_KEY]) {
compiledValidator = this.ajv.getSchema(schemaWithIdRefPrefix[utils.ID_KEY]);
}
compiledValidator = this.ajv.getSchema(schemaId);
if (compiledValidator === undefined) {
compiledValidator = this.ajv.compile(schemaWithIdRefPrefix);
// Add schema by an explicit ID so it can be fetched later
// Fall back to using compile if necessary
// https://ajv.js.org/guide/managing-schemas.html#pre-adding-all-schemas-vs-adding-on-demand
compiledValidator = this.ajv.addSchema(schemaWithIdRefPrefix, schemaId).getSchema(schemaId) || this.ajv.compile(schemaWithIdRefPrefix);
}

@@ -321,0 +324,0 @@ var result = compiledValidator(formData);

@@ -1,2 +0,2 @@

!function(r,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@rjsf/utils"),require("ajv"),require("ajv-formats"),require("lodash-es/isObject"),require("lodash-es/get"),require("lodash-es/isEqual")):"function"==typeof define&&define.amd?define(["exports","@rjsf/utils","ajv","ajv-formats","lodash-es/isObject","lodash-es/get","lodash-es/isEqual"],e):e((r="undefined"!=typeof globalThis?globalThis:r||self)["@rjsf/validator-ajv8"]={},r.utils,r.Ajv,r.addFormats,r.isObject,r.get,r.isEqual)}(this,(function(r,e,t,a,i,o,s){"use strict";function n(r){return r&&"object"==typeof r&&"default"in r?r:{default:r}}var l=n(t),d=n(a),c=n(i),h=n(o),u=n(s);function f(){return f=Object.assign?Object.assign.bind():function(r){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var a in t)Object.prototype.hasOwnProperty.call(t,a)&&(r[a]=t[a])}return r},f.apply(this,arguments)}var v={allErrors:!0,multipleOfPrecision:8,strict:!1,verbose:!0},m=/^(#?([0-9A-Fa-f]{3}){1,2}\b|aqua|black|blue|fuchsia|gray|green|lime|maroon|navy|olive|orange|purple|red|silver|teal|white|yellow|(rgb\(\s*\b([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\b\s*,\s*\b([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\b\s*,\s*\b([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\b\s*\))|(rgb\(\s*(\d?\d%|100%)+\s*,\s*(\d?\d%|100%)+\s*,\s*(\d?\d%|100%)+\s*\)))$/,p=/^data:([a-z]+\/[a-z0-9-+.]+)?;(?:name=(.*);)?base64,(.*)$/,g=["instancePath","keyword","params","schemaPath","parentSchema"];function y(r,t,a,i,o,s,n){var l=t.validationError,d=function(r,t){return void 0===r&&(r=[]),r.map((function(r){var a=r.instancePath,i=r.keyword,o=r.params,s=r.schemaPath,n=r.parentSchema,l=function(r,e){if(null==r)return{};var t,a,i={},o=Object.keys(r);for(a=0;a<o.length;a++)e.indexOf(t=o[a])>=0||(i[t]=r[t]);return i}(r,g).message,d=void 0===l?"":l,c=a.replace(/\//g,"."),u=(c+" "+d).trim();if("missingProperty"in o){var f=o.missingProperty,v=e.getUiOptions(h.default(t,""+(c=c?c+"."+o.missingProperty:o.missingProperty).replace(/^\./,""))).title;if(v)d=d.replace(f,v);else{var m=h.default(n,[e.PROPERTIES_KEY,f,"title"]);m&&(d=d.replace(f,m))}u=d}else{var p=e.getUiOptions(h.default(t,""+c.replace(/^\./,""))).title;if(p)u=("'"+p+"' "+d).trim();else{var y=null==n?void 0:n.title;y&&(u=("'"+y+"' "+d).trim())}}return{name:i,property:c,message:d,params:o,stack:u,schemaPath:s}}))}(t.errors,n);l&&(d=[].concat(d,[{stack:l.message}])),"function"==typeof s&&(d=s(d,n));var c=e.toErrorSchema(d);if(l&&(c=f({},c,{$schema:{__errors:[l.message]}})),"function"!=typeof o)return{errors:d,errorSchema:c};var u=e.getDefaultFormState(r,i,a,i,!0),v=o(u,e.createErrorHandler(u),n),m=e.unwrapErrorHandler(v);return e.validationDataMerge({errors:d,errorSchema:c},m)}var E=function(){function r(r,t){this.ajv=void 0,this.localizer=void 0,this.ajv=function(r,t,a,i,o){void 0===a&&(a={}),void 0===o&&(o=l.default);var s=new o(f({},v,a));return i?d.default(s,i):!1!==i&&d.default(s),s.addFormat("data-url",p),s.addFormat("color",m),s.addKeyword(e.ADDITIONAL_PROPERTY_FLAG),s.addKeyword(e.RJSF_ADDITONAL_PROPERTIES_FLAG),Array.isArray(r)&&s.addMetaSchema(r),c.default(t)&&Object.keys(t).forEach((function(r){s.addFormat(r,t[r])})),s}(r.additionalMetaSchemas,r.customFormats,r.ajvOptionsOverrides,r.ajvFormatOptions,r.AjvClass),this.localizer=t}var t=r.prototype;return t.toErrorList=function(r,t){return void 0===t&&(t=[]),e.toErrorList(r,t)},t.rawValidation=function(r,t){var a,i,o=void 0;r[e.ID_KEY]&&(a=this.ajv.getSchema(r[e.ID_KEY]));try{void 0===a&&(a=this.ajv.compile(r)),a(t)}catch(r){o=r}return a&&("function"==typeof this.localizer&&this.localizer(a.errors),i=a.errors||void 0,a.errors=null),{errors:i,validationError:o}},t.validateFormData=function(r,e,t,a,i){return y(this,this.rawValidation(e,r),r,e,t,a,i)},t.isValid=function(r,t,a){var i,o=null!=(i=a[e.ID_KEY])?i:e.ROOT_SCHEMA_PREFIX;try{void 0===this.ajv.getSchema(o)&&this.ajv.addSchema(a,o);var s,n=e.withIdRefPrefix(r);return n[e.ID_KEY]&&(s=this.ajv.getSchema(n[e.ID_KEY])),void 0===s&&(s=this.ajv.compile(n)),s(t)}catch(r){return console.warn("Error encountered compiling schema:",r),!1}finally{this.ajv.removeSchema(o)}},r}();function j(r,e){return void 0===r&&(r={}),new E(r,e)}var b=function(){function r(r,t,a){this.rootSchema=void 0,this.resolvedRootSchema=void 0,this.validateFns=void 0,this.mainValidator=void 0,this.localizer=void 0,this.rootSchema=t,this.validateFns=r,this.localizer=a,this.mainValidator=this.getValidator(t),this.resolvedRootSchema=e.retrieveSchema(this,t,t)}var t=r.prototype;return t.getValidator=function(r){var t=h.default(r,e.ID_KEY)||e.hashForSchema(r),a=this.validateFns[t];if(!a)throw new Error('No precompiled validator function was found for the given schema for "'+t+'"');return a},t.toErrorList=function(r,t){return void 0===t&&(t=[]),e.toErrorList(r,t)},t.rawValidation=function(r,e){if(!u.default(r,this.resolvedRootSchema))throw new Error("The schema associated with the precompiled schema differs from the schema provided for validation");this.mainValidator(e),"function"==typeof this.localizer&&this.localizer(this.mainValidator.errors);var t=this.mainValidator.errors||void 0;return this.mainValidator.errors=null,{errors:t}},t.validateFormData=function(r,e,t,a,i){return y(this,this.rawValidation(e,r),r,e,t,a,i)},t.isValid=function(r,t,a){if(!u.default(a,this.rootSchema))throw new Error("The schema associated with the precompiled validator differs from the rootSchema provided for validation");return h.default(r,e.ID_KEY)!==e.JUNK_OPTION_ID&&this.getValidator(r)(t)},r}(),w=j();r.createPrecompiledValidator=function(r,e,t){return new b(r,e,t)},r.customizeValidator=j,r.default=w,Object.defineProperty(r,"__esModule",{value:!0})}));
!function(r,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@rjsf/utils"),require("ajv"),require("ajv-formats"),require("lodash-es/isObject"),require("lodash-es/get"),require("lodash-es/isEqual")):"function"==typeof define&&define.amd?define(["exports","@rjsf/utils","ajv","ajv-formats","lodash-es/isObject","lodash-es/get","lodash-es/isEqual"],e):e((r="undefined"!=typeof globalThis?globalThis:r||self)["@rjsf/validator-ajv8"]={},r.utils,r.Ajv,r.addFormats,r.isObject,r.get,r.isEqual)}(this,(function(r,e,t,a,i,o,s){"use strict";function n(r){return r&&"object"==typeof r&&"default"in r?r:{default:r}}var l=n(t),d=n(a),c=n(i),h=n(o),u=n(s);function f(){return f=Object.assign?Object.assign.bind():function(r){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var a in t)Object.prototype.hasOwnProperty.call(t,a)&&(r[a]=t[a])}return r},f.apply(this,arguments)}var v={allErrors:!0,multipleOfPrecision:8,strict:!1,verbose:!0},m=/^(#?([0-9A-Fa-f]{3}){1,2}\b|aqua|black|blue|fuchsia|gray|green|lime|maroon|navy|olive|orange|purple|red|silver|teal|white|yellow|(rgb\(\s*\b([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\b\s*,\s*\b([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\b\s*,\s*\b([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\b\s*\))|(rgb\(\s*(\d?\d%|100%)+\s*,\s*(\d?\d%|100%)+\s*,\s*(\d?\d%|100%)+\s*\)))$/,p=/^data:([a-z]+\/[a-z0-9-+.]+)?;(?:name=(.*);)?base64,(.*)$/,g=["instancePath","keyword","params","schemaPath","parentSchema"];function y(r,t,a,i,o,s,n){var l=t.validationError,d=function(r,t){return void 0===r&&(r=[]),r.map((function(r){var a=r.instancePath,i=r.keyword,o=r.params,s=r.schemaPath,n=r.parentSchema,l=function(r,e){if(null==r)return{};var t,a,i={},o=Object.keys(r);for(a=0;a<o.length;a++)e.indexOf(t=o[a])>=0||(i[t]=r[t]);return i}(r,g).message,d=void 0===l?"":l,c=a.replace(/\//g,"."),u=(c+" "+d).trim();if("missingProperty"in o){var f=o.missingProperty,v=e.getUiOptions(h.default(t,""+(c=c?c+"."+o.missingProperty:o.missingProperty).replace(/^\./,""))).title;if(v)d=d.replace(f,v);else{var m=h.default(n,[e.PROPERTIES_KEY,f,"title"]);m&&(d=d.replace(f,m))}u=d}else{var p=e.getUiOptions(h.default(t,""+c.replace(/^\./,""))).title;if(p)u=("'"+p+"' "+d).trim();else{var y=null==n?void 0:n.title;y&&(u=("'"+y+"' "+d).trim())}}return{name:i,property:c,message:d,params:o,stack:u,schemaPath:s}}))}(t.errors,n);l&&(d=[].concat(d,[{stack:l.message}])),"function"==typeof s&&(d=s(d,n));var c=e.toErrorSchema(d);if(l&&(c=f({},c,{$schema:{__errors:[l.message]}})),"function"!=typeof o)return{errors:d,errorSchema:c};var u=e.getDefaultFormState(r,i,a,i,!0),v=o(u,e.createErrorHandler(u),n),m=e.unwrapErrorHandler(v);return e.validationDataMerge({errors:d,errorSchema:c},m)}var j=function(){function r(r,t){this.ajv=void 0,this.localizer=void 0,this.ajv=function(r,t,a,i,o){void 0===a&&(a={}),void 0===o&&(o=l.default);var s=new o(f({},v,a));return i?d.default(s,i):!1!==i&&d.default(s),s.addFormat("data-url",p),s.addFormat("color",m),s.addKeyword(e.ADDITIONAL_PROPERTY_FLAG),s.addKeyword(e.RJSF_ADDITONAL_PROPERTIES_FLAG),Array.isArray(r)&&s.addMetaSchema(r),c.default(t)&&Object.keys(t).forEach((function(r){s.addFormat(r,t[r])})),s}(r.additionalMetaSchemas,r.customFormats,r.ajvOptionsOverrides,r.ajvFormatOptions,r.AjvClass),this.localizer=t}var t=r.prototype;return t.toErrorList=function(r,t){return void 0===t&&(t=[]),e.toErrorList(r,t)},t.rawValidation=function(r,t){var a,i,o=void 0;r[e.ID_KEY]&&(a=this.ajv.getSchema(r[e.ID_KEY]));try{void 0===a&&(a=this.ajv.compile(r)),a(t)}catch(r){o=r}return a&&("function"==typeof this.localizer&&this.localizer(a.errors),i=a.errors||void 0,a.errors=null),{errors:i,validationError:o}},t.validateFormData=function(r,e,t,a,i){return y(this,this.rawValidation(e,r),r,e,t,a,i)},t.isValid=function(r,t,a){var i,o=null!=(i=a[e.ID_KEY])?i:e.ROOT_SCHEMA_PREFIX;try{var s;void 0===this.ajv.getSchema(o)&&this.ajv.addSchema(a,o);var n,l=e.withIdRefPrefix(r),d=null!=(s=l[e.ID_KEY])?s:e.hashForSchema(l);return void 0===(n=this.ajv.getSchema(d))&&(n=this.ajv.addSchema(l,d).getSchema(d)||this.ajv.compile(l)),n(t)}catch(r){return console.warn("Error encountered compiling schema:",r),!1}finally{this.ajv.removeSchema(o)}},r}();function E(r,e){return void 0===r&&(r={}),new j(r,e)}var S=function(){function r(r,t,a){this.rootSchema=void 0,this.resolvedRootSchema=void 0,this.validateFns=void 0,this.mainValidator=void 0,this.localizer=void 0,this.rootSchema=t,this.validateFns=r,this.localizer=a,this.mainValidator=this.getValidator(t),this.resolvedRootSchema=e.retrieveSchema(this,t,t)}var t=r.prototype;return t.getValidator=function(r){var t=h.default(r,e.ID_KEY)||e.hashForSchema(r),a=this.validateFns[t];if(!a)throw new Error('No precompiled validator function was found for the given schema for "'+t+'"');return a},t.toErrorList=function(r,t){return void 0===t&&(t=[]),e.toErrorList(r,t)},t.rawValidation=function(r,e){if(!u.default(r,this.resolvedRootSchema))throw new Error("The schema associated with the precompiled schema differs from the schema provided for validation");this.mainValidator(e),"function"==typeof this.localizer&&this.localizer(this.mainValidator.errors);var t=this.mainValidator.errors||void 0;return this.mainValidator.errors=null,{errors:t}},t.validateFormData=function(r,e,t,a,i){return y(this,this.rawValidation(e,r),r,e,t,a,i)},t.isValid=function(r,t,a){if(!u.default(a,this.rootSchema))throw new Error("The schema associated with the precompiled validator differs from the rootSchema provided for validation");return h.default(r,e.ID_KEY)!==e.JUNK_OPTION_ID&&this.getValidator(r)(t)},r}(),b=E();r.createPrecompiledValidator=function(r,e,t){return new S(r,e,t)},r.customizeValidator=E,r.default=b,Object.defineProperty(r,"__esModule",{value:!0})}));
//# sourceMappingURL=validator-ajv8.umd.production.min.js.map
{
"name": "@rjsf/validator-ajv8",
"version": "5.8.1",
"version": "5.8.2",
"main": "dist/index.js",

@@ -49,3 +49,3 @@ "module": "dist/validator-ajv8.esm.js",

"@babel/preset-react": "^7.22.3",
"@rjsf/utils": "^5.8.1",
"@rjsf/utils": "^5.8.2",
"@types/jest-expect-message": "^1.1.0",

@@ -80,3 +80,3 @@ "@types/json-schema": "^7.0.12",

"license": "Apache-2.0",
"gitHead": "58fd7da5e6db287b4fc842fcb7dd0dba38ff8d89"
"gitHead": "75c8007dae1537d9c0c094f2bf34f3b328f44e6b"
}

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

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc