Socket
Socket
Sign inDemoInstall

@rjsf/validator-ajv8

Package Overview
Dependencies
Maintainers
2
Versions
75
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@rjsf/validator-ajv8 - npm Package Compare versions

Comparing version 5.7.2 to 5.7.3

3

dist/index.cjs.development.js

@@ -385,2 +385,5 @@ 'use strict';

}
if (get__default["default"](schema, utils.ID_KEY) === utils.JUNK_OPTION_ID) {
return false;
}
var validator = this.getValidator(schema);

@@ -387,0 +390,0 @@ return validator(formData);

2

dist/index.cjs.production.min.js

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

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

@@ -457,2 +457,5 @@ import addFormats from 'ajv-formats';

}
if (get(schema, ID_KEY) === JUNK_OPTION_ID) {
return false;
}
var validator = this.getValidator(schema);

@@ -459,0 +462,0 @@ return validator(formData);

@@ -464,2 +464,5 @@ (function (global, factory) {

}
if (get__default["default"](schema, utils.ID_KEY) === utils.JUNK_OPTION_ID) {
return false;
}
var validator = this.getValidator(schema);

@@ -466,0 +469,0 @@ return validator(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),u=n(o),h=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,"."),h=(c+" "+d).trim();if("missingProperty"in o){var f=o.missingProperty,v=e.getUiOptions(u.default(t,""+(c=c?c+"."+o.missingProperty:o.missingProperty).replace(/^\./,""))).title;if(v)d=d.replace(f,v);else{var m=u.default(n,[e.PROPERTIES_KEY,f,"title"]);m&&(d=d.replace(f,m))}h=d}else{var p=e.getUiOptions(u.default(t,""+c.replace(/^\./,""))).title;if(p)h=("'"+p+"' "+d).trim();else{var y=null==n?void 0:n.title;y&&(h=("'"+y+"' "+d).trim())}}return{name:i,property:c,message:d,params:o,stack:h,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 h=e.getDefaultFormState(r,i,a,i,!0),v=o(h,e.createErrorHandler(h),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{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 E(r,e){return void 0===r&&(r={}),new j(r,e)}var b=function(){function r(r,e,t){this.rootSchema=void 0,this.validateFns=void 0,this.mainValidator=void 0,this.localizer=void 0,this.rootSchema=e,this.validateFns=r,this.localizer=t,this.mainValidator=this.getValidator(e)}var t=r.prototype;return t.getValidator=function(r){var t=u.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(!h.default(r,this.rootSchema))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,e,t){if(!h.default(t,this.rootSchema))throw new Error("The schema associated with the precompiled validator differs from the rootSchema provided for validation");return this.getValidator(r)(e)},r}(),w=E();r.createPrecompiledValidator=function(r,e,t){return new b(r,e,t)},r.customizeValidator=E,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),u=n(o),h=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,"."),h=(c+" "+d).trim();if("missingProperty"in o){var f=o.missingProperty,v=e.getUiOptions(u.default(t,""+(c=c?c+"."+o.missingProperty:o.missingProperty).replace(/^\./,""))).title;if(v)d=d.replace(f,v);else{var m=u.default(n,[e.PROPERTIES_KEY,f,"title"]);m&&(d=d.replace(f,m))}h=d}else{var p=e.getUiOptions(u.default(t,""+c.replace(/^\./,""))).title;if(p)h=("'"+p+"' "+d).trim();else{var y=null==n?void 0:n.title;y&&(h=("'"+y+"' "+d).trim())}}return{name:i,property:c,message:d,params:o,stack:h,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 h=e.getDefaultFormState(r,i,a,i,!0),v=o(h,e.createErrorHandler(h),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,e,t){this.rootSchema=void 0,this.validateFns=void 0,this.mainValidator=void 0,this.localizer=void 0,this.rootSchema=e,this.validateFns=r,this.localizer=t,this.mainValidator=this.getValidator(e)}var t=r.prototype;return t.getValidator=function(r){var t=u.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(!h.default(r,this.rootSchema))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(!h.default(a,this.rootSchema))throw new Error("The schema associated with the precompiled validator differs from the rootSchema provided for validation");return u.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})}));
//# sourceMappingURL=validator-ajv8.umd.production.min.js.map
{
"name": "@rjsf/validator-ajv8",
"version": "5.7.2",
"version": "5.7.3",
"main": "dist/index.js",

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

"@babel/preset-react": "^7.18.6",
"@rjsf/utils": "^5.7.2",
"@rjsf/utils": "^5.7.3",
"@types/jest-expect-message": "^1.1.0",

@@ -54,5 +54,5 @@ "@types/json-schema": "^7.0.11",

"dts-cli": "^1.6.3",
"eslint": "^8.40.0",
"eslint": "^8.41.0",
"jest-expect-message": "^1.1.3",
"rimraf": "^5.0.0"
"rimraf": "^5.0.1"
},

@@ -80,3 +80,3 @@ "publishConfig": {

"license": "Apache-2.0",
"gitHead": "4be621cc40425cac212a468eff0f8cb14096f82c"
"gitHead": "9d1a4389e5d759681f878717629337c92173f95d"
}

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc