You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 7-8.RSVP
Socket
Socket
Sign inDemoInstall

schema-to-yup

Package Overview
Dependencies
Maintainers
1
Versions
66
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.11.1 to 1.11.2

2

dist/index.js

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

var t=require("yup"),e=require("uniq"),n=require("dashify"),r=require("uppercamelcase");function i(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}function s(t){if(t&&t.__esModule)return t;var e=Object.create(null);return t&&Object.keys(t).forEach(function(n){if("default"!==n){var r=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,r.get?r:{enumerable:!0,get:function(){return t[n]}})}}),e.default=t,e}var a=/*#__PURE__*/s(t),o=/*#__PURE__*/i(e),u=/*#__PURE__*/i(n),c=/*#__PURE__*/i(r);function h(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function f(t,e,n){return e&&h(t.prototype,e),n&&h(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function l(){return l=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},l.apply(this,arguments)}function p(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,y(t,e)}function d(t){return d=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},d(t)}function y(t,e){return y=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},y(t,e)}function v(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}function m(t,e,n){return m=v()?Reflect.construct:function(t,e,n){var r=[null];r.push.apply(r,e);var i=new(Function.bind.apply(t,r));return n&&y(i,n.prototype),i},m.apply(null,arguments)}function g(t){var e="function"==typeof Map?new Map:void 0;return g=function(t){if(null===t||-1===Function.toString.call(t).indexOf("[native code]"))return t;if("function"!=typeof t)throw new TypeError("Super expression must either be null or a function");if(void 0!==e){if(e.has(t))return e.get(t);e.set(t,n)}function n(){return m(t,arguments,d(this).constructor)}return n.prototype=Object.create(t.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),y(n,t)},g(t)}var b={getProps:function(t){return t&&t.properties},getType:function(t){return t&&t.type},getName:function(t){return t&&(t.name||t.title)},getConstraints:function(t){return t},isString:function(t){return t&&"string"===t.type},isArray:function(t){return t&&"array"===t.type},isInteger:function(t){return t&&("integer"===t.type||"int"===t.type)},isBoolean:function(t){return t&&"boolean"===t.type},hasDateFormat:function(t){return t&&["date","date-time"].find(function(e){return e===t.format})},isDate:function(t){return t&&"string"===t.type&&b.hasDateFormat(t.format)},isNumber:function(t){return t&&("number"===t.type||b.isInteger(t))},isObject:function(t){return t&&"object"===t.type},isRequired:function(t){return t&&t.required}},w={getProps:function(t){return t.properties},getType:function(t){return t.type},getName:function(t){return t.name||t.title},getConstraints:function(t){return t},isString:function(t){return"string"===t.type&&!w.hasDateFormat(t)},isArray:function(t){return"array"===t.type},isBoolean:function(t){return"boolean"===t.type},isInteger:function(t){return"integer"===t.type},hasDateFormat:function(t){var e;return["date","date-time"].includes(null==t||null==(e=t.value)?void 0:e.format)},isDate:function(t){return"string"===t.type&&w.hasDateFormat(t)},isNumber:function(t){return"number"===t.type||w.isInteger(t)},isObject:function(t){return"object"===t.type},isRequired:function(t){return t.required}},C={getProps:function(t){return t&&t.fields},getType:function(t){return t&&t.type},getName:function(t){return t&&(t.name||t.title)},getConstraints:function(t){return t},isString:function(t){return t&&"string"===t.type},isArray:function(t){return t&&"array"===t.type},isInteger:function(t){return t&&"int"===t.type},isFloat:function(t){return t&&"float"===t.type},isDouble:function(t){return t&&"double"===t.type},isBoolean:function(t){return t&&"boolean"===t.type},isDate:function(t){return t&&"int"===t.type&&"date"===t.logicalType},isNumber:function(t){return t&&(C.isInteger(t)||C.isFloat(t)||C.isDouble(t))},isObject:function(t){return t&&"record"===t.type},isRequired:function(t){return t&&t.required}},k={"json-schema":b,"type-def":w,avro:C},E=/*#__PURE__*/function(t){function e(e){return void 0===e&&(e={}),t.call(this,e)||this}p(e,t);var n=e.prototype;return n.isNothing=function(t){return null==t},n.isPresent=function(t){return!this.isNothing(t)},n.toNumber=function(t){return Number(t)},n.isNumberLike=function(t){return!isNaN(this.toNumber(t))},n.isObjectType=function(t){return t===Object(t)},n.isArrayType=function(t){return Array.isArray(t)},n.isNumberType=function(t){return!isNaN(t)},n.isStringType=function(t){return"string"==typeof t},n.isFunctionType=function(t){return"function"==typeof t},n.isDateType=function(t){return t instanceof Date},e}(/*#__PURE__*/function(){function t(t){void 0===t&&(t={}),this.config=t;var e=t.log,n=t.error;this.enable=t.enable||{},this.log="function"==typeof e?e:console.log,this.err="function"==typeof n?n:console.error}var e=t.prototype;return e.error=function(t,e){if(!1!==this.enable.error)throw this.err&&(e?this.err(t,e):this.err(t)),t},e.warn=function(t,e){this.enable.warn&&this.logInfo("WARNING: "+t,e)},e.logInfo=function(t,e){this.enable.log&&this.log&&(e?this.log(t,e):this.log(t))},t}()),O=/*#__PURE__*/function(){function t(t,e){this.schemaParserMap=t,this.name=e}var e=t.prototype;return e.lookup=function(t){return void 0===t&&(t=this.name),this.schemaParserMap[t]},e.build=function(){var t=this.lookup();if(t.extends){var e=this.extend(t.extends);if(e)return e}return t},e.extend=function(t){var e=this.lookup(t);e&&(entry=l({},e,this.lookup()))},t}(),T=/*#__PURE__*/function(t){function e(e){var n;void 0===e&&(e={}),n=t.call(this,e)||this;var r=(e.createSchemaParserBuilder||new O(e.schemaParserMap||k,e.schemaType||"json-schema")).build();return n.config=l({},r,e),n}return p(e,t),e.prototype.createSchemaParserBuilder=function(t,e){return new SchemaParserBuilder(t,e)},e}(E);function M(t){return t===Object(t)}var N=/*#__PURE__*/function(){function t(t,e){void 0===e&&(e={}),this.whenEntryObj=t;var n=e.properties,r=e.config,i=e.key,s=e.when,a=e.type;this.schema=e.schema,this.when=s,this.properties=n||{},this.key=i,this.type=a,this.config=r}var e=t.prototype;return e.validateAndConfigure=function(t){if(!M(t=t||this.whenEntryObj))return this.warn("invalid or missing when entry constraint object",t),!1;var e=Object.keys(t);return e.length<2?(this.warn("validateAndConfigure: when entry constraint must have at least 2 keys: "+e,t),!1):this.hasKey(e,"is")?!!this.hasKey(e,"then")||(this.warn("validateAndConfigure: when entry constraint missing 'then' or 'else' constraint: "+e,t),!1):(this.warn("validateAndConfigure: when entry constraint missing 'is' constraint: "+e,t),!1)},e.createYupSchemaEntry=function(t){return this.config.createYupSchemaEntry(t)},e.createValue=function(t,e){var n;return"string"==typeof t&&((n={})[t]=!0,t=n),M(t)||this.error("createValue: "+e+" must be a schema object"),l({key:this.key,type:this.type},t)},e.createEntryOpts=function(t,e){var n=this.createValue(t,e);return{schema:this.schema,properties:this.properties,key:this.key,type:this.type,value:n,config:this.config}},e.createEntry=function(t,e){var n=this.createEntryOpts(t,e);return this.createYupSchemaEntry(n)},e.hasKey=function(t,e){return t.find(function(t){return t===e})},e.hasAnyKey=function(t,e){return t.find(function(t){return e.includes(t)})},e.whenEntryFor=function(t,e,n){var r;if(n=n||e,"string"==typeof t&&((r={})[t]=!0,t=r),!M(t))throw"whenEntryFor: Invalid when object "+t;var i=l({},t[n]);return delete t[n],i?(t[e]=this.createEntry(i,e),t):t},e.calcEntryObj=function(){var t=l({},this.whenEntryObj);return"otherwise"in(t=this.whenEntryFor(t,"then"))&&(t=this.whenEntryFor(t,"otherwise")),"else"in t&&(t=this.whenEntryFor(t,"else")),t},e.warn=function(t,e){console.error("[WhenEntry] WARNING",t,e)},e.error=function(t,e){throw console.error("[WhenEntry] ERROR",t,e),t},f(t,[{key:"entryObj",get:function(){return this.validateAndConfigure()&&this.calcEntryObj()}}]),t}();function x(t){return t===Object(t)}var j=/*#__PURE__*/function(){function t(t){void 0===t&&(t={});var e=t.type,n=t.key,r=t.value,i=t.when,s=t.schema,a=t.properties,o=t.config;this.opts=t,this.when=i,this.key=n,this.type=e,this.value=r,this.schema=s,this.properties=a,this.config=o,this.validate()}var e=t.prototype;return e.validate=function(){"string"!=typeof this.type&&this.error("validate: invalid or mising type: "+this.type,this.opts),x(this.when)||this.error("validate: invalid or mising when: "+this.when,this.opts)},e.validateAndConfigure=function(t){if(!x(t=t||this.when))return this.warn("invalid or missing when constraint",t),!1;var e=Object.keys(t);return e.length<1?(this.warn("when constraint must have at least 1 key: "+e,t),!1):(this.whenKeys=e,!0)},e.createWhenEntry=function(t,e){return function(t,e){return void 0===e&&(e={}),new N(t,e)}(t,e)},e.accumulate=function(t,e){var n=this.when[e];if(!x(n))return this.warn("invalid when entry constraint object "+n+" for "+e),t;var r=this.createWhenEntry(n,{type:this.type,key:this.key,schema:this.schema,properties:this.properties,config:this.config}).entryObj;return r?t=Object.assign(t,r):t},e.warn=function(t,e){console.error("[WhenCondition] WARNING",t,e)},e.error=function(t,e){throw console.error("[WhenCondition] ERROR",t,e),t},f(t,[{key:"constraintObj",get:function(){return this.whenKeys?this.whenKeys.reduce(this.accumulate.bind(this),{}):{}}},{key:"keyVal",get:function(){var t=this.whenKeys||[];return 1===t.length?t[0]:t}},{key:"constraintValue",get:function(){return!!this.keyVal&&[this.keyVal,this.constraintObj]}},{key:"constraint",get:function(){return this.validateAndConfigure()&&this.constraintValue}}]),t}(),S=function(t){return new j(t)},V=/*#__PURE__*/function(t){function e(e,n){var r;return void 0===n&&(n={}),(r=t.call(this,n)||this).typeHandler=e,r.constraintsAdded={},r.delegators.map(function(t){r[t]=e[t]}),r}p(e,t);var n=e.prototype;return n.build=function(t,e){void 0===e&&(e={});var n=e.constraintName,r=e.constraintValue,i=e.method,s=e.yup,a=e.value,o=e.values,u=e.errName;if(s=s||this.base,this.isNothing(r=r||e.propValue||this.constraints[t]))return this.warn("no prop value"),!1;n=n||t;var c=this.aliasMap[i=i||n]||i;if(!s[c])return this.warn("Yup has no such API method: "+c),!1;for(var h,f=s[c].bind(s),l=this.valErrMessage(n),p=u&&this.valErrMessage(u),d={constraintName:n,yup:s,constraintFn:f,errFn:l||p},y=0,v=["multiValueConstraint","presentConstraintValue","nonPresentConstraintValue"];y<v.length&&!(h=this[v[y]](a||o,d));y++);return h?(this.base=h,h):(this.warn("buildConstraint: missing value or values options"),!1)},n.nonPresentConstraintValue=function(t,e){var n=e.constraintName,r=e.constraintFn,i=e.errFn;if(!this.isPresent(t))return this.onConstraintAdded({name:n}),r(i)},n.presentConstraintValue=function(t,e){var n=e.constraintName,r=e.constraintFn,i=e.errFn;if(this.isPresent(t))return this.onConstraintAdded({name:n,value:t}),this.isNoValueConstraint(n)?r(i):r(t,i)},n.multiValueConstraint=function(t,e){var n=e.constraintFn,r=e.constraintName,i=e.errFn;if(this.isPresent(t)){if(Array.isArray(t))return this.onConstraintAdded({name:r,value:t}),this.callConstraintFn(n,r,t,i);this.warn("buildConstraint: values option must be an array of arguments")}},n.callConstraintFn=function(t,e,n,r){return this.isMultiArgsCall(e)?t.apply(void 0,n.concat([r])):t(n,r)},n.isMultiArgsCall=function(t){return this.multiArgsValidatorMethods[t]},n.isNoValueConstraint=function(t){return this.noValueConstraints.includes(t)},n.addValueConstraint=function(t,e){var n=void 0===e?{}:e;return this.addConstraint(t,{constraintName:n.constraintName,value:!0,errName:n.errName})},n.addConstraint=function(t,e){var n=this.build(t,e);return!!n&&(this.typeHandler.base=n,n)},n.onConstraintAdded=function(t){return this.constraintsAdded[t.name]=t.value,this.typeHandler},n.valErrMessage=function(t){return this.errorMessageHandler.valErrMessage(t)},f(e,[{key:"delegators",get:function(){return["errMessages","base","key","constraints","errorMessageHandler"]}},{key:"multiArgsValidatorMethods",get:function(){return this.config.multiArgsValidatorMethods||{when:!0}}},{key:"noValueConstraints",get:function(){return["required","email","url","format"]}},{key:"constraintsMap",get:function(){return{simple:["required","notRequired","nullable"],value:["default","strict"]}}},{key:"aliasMap",get:function(){return{oneOf:"oneOf",enum:"oneOf",anyOf:"oneOf"}}}]),e}(E),A=/*#__PURE__*/function(t){function e(e,n){var r;return void 0===n&&(n={}),(r=t.call(this,n)||this).typeHandler=e,r.constraints=e.constraints,r.errMessages=e.errMessages,r.key=e.key,r.type=e.type,r}p(e,t);var n=e.prototype;return n.valErrMessage=function(t){var e=this.constraints,n=this.errMessageFor(t);return"function"==typeof n?n(e):n},n.errMessageFor=function(t){var e=this.errMessages,n=e[this.key];return n?n[t]:e["$"+t]},e}(E),I=/*#__PURE__*/function(t){function e(){return t.apply(this,arguments)||this}return p(e,t),e}(/*#__PURE__*/g(Error)),F=/*#__PURE__*/function(t){function e(e){var n;return void 0===e&&(e={}),(n=t.call(this,e.config)||this).init(e),n}p(e,t);var n=e.prototype;return n.init=function(t){var e=t.schema,n=t.key,r=t.value,i=t.config,s=t.entryHandler;i=i||{},e=e||{},this.validateOnCreate(n,r,t),this.opts=t,this.entryHandler=s,this.validator=this.getValidator(),this.key=n,this.schema=e,this.properties=e.properties||{},this.value=r,this.constraints=this.getConstraints(),this.format=r.format||this.constraints.format,this.config=i||{},this.type=this.baseType,this.mixedConfig=this.config.mixedEnabled||{},this.typeConfig=this.config[this.type]||{},this.errMessages=i.errMessages||{},this.configureTypeConfig(),this.constraintsAdded={},this.base=this.getBase()},n.getBase=function(){return this.customBaseValidator||this.validatorInstance},n.getValidator=function(){return this.opts.validator||this.config.validator||this.entryHandler&&this.entryHandler.validator||a},n.configureTypeConfig=function(){this.typeConfig.enabled||this.typeConfig.extends||this.typeConfig.convert&&(this.typeConfig.extends=Object.keys(this.typeConfig.convert))},n.isRequired=function(t){return!0===(t=t||this.value).required},n.disabledMode=function(t){var e=this.mode[t];return!!this.disableFlags.find(function(t){return e===t})},n.enabledMode=function(t){var e=this.mode[t];return!!this.enableFlags.find(function(t){return e===t})},n.preProcessedConstraintValue=function(t){return this.shouldPreProcessValue?this.isRequired(t)?t:l({},t,{notRequired:!0}):t},n.initHelpers=function(){var t=this.config;this.errorMessageHandler=(this.config.createErrorMessageHandler||this.createErrorMessageHandler)(this,t),this.constraintBuilder=(this.config.createConstraintBuilder||this.createConstraintBuilder)(this,t),this.rebind("addConstraint","addValueConstraint")},n.createConstraintBuilder=function(t,e){return void 0===e&&(e={}),new V(t,e)},n.createErrorMessageHandler=function(t,e){return void 0===e&&(e={}),new A(t,e)},n.rebind=function(){var t=this;[].slice.call(arguments).map(function(e){var n=t[e];t[e]=t.isFunctionType(n)?n.bind(t):n})},n.validateOnCreate=function(t,e,n){t||this.error("create: missing key "+JSON.stringify(n)),e||this.error("create: missing value "+JSON.stringify(n))},n.convertEnabled=function(){var t=this;this.enabled.map(function(e){var n=t.convertFnFor(e);n&&n(t)})},n.convertFnFor=function(t){return this.customConvertFnFor(t,this)||this.builtInConvertFnFor(t)},n.customConvertFnFor=function(t){return(this.typeConfig.convert||{})[t]},n.builtInConvertFnFor=function(t){return this[t].bind(this)},n.getConstraints=function(){return this.config.getConstraints(this.value)},n.createSchemaEntry=function(){return this.convert().base},n.convert=function(){return this.initHelpers(),this.addMappedConstraints(),this.convertEnabled(),this},n.apply=function(t){var e,n=[].slice.call(arguments,1);if("string"!=typeof t)throw new TypeError("[Mixed] apply must take a method name available on the validator instance as first argument");return this.base=n&&n.length&&(e=this.base)[t].apply(e,n)||this.base,this},n.addValueConstraint=function(t,e){var n=this.constraintBuilder.addValueConstraint(t,e);return n&&(this.base=n.base),this},n.addConstraint=function(t,e){if(!this.constraintBuilder)throw new Error("[YupMixed] addConstraint: Missing constraintBuilder in "+this.constructor.name);var n=this.constraintBuilder.addConstraint(t,e);return n&&(this.base=n),this},n.addMappedConstraints=function(){var t=Object.keys(this.constraintsMap),e=this.addMappedConstraint.bind(this);return t.map(e),this},n.addMappedConstraint=function(t){var e=this["value"===t?"addValueConstraint":"addConstraint"];this.constraintsMap[t].map(function(t){e(t)})},n.oneOf=function(){var t=this,e=this.constraints.enum||this.constraints.oneOf||this.constraints.anyOf;if(this.isNothing(e))return this;e=Array.isArray(e)?e:[e];var n=["oneOf","enum","anyOf"].find(function(e){return void 0!==t.constraints[e]});return this.addConstraint(n,{values:e})},n.notOneOf=function(){var t=this.constraints,e=t.not,n=t.notOneOf||e&&(e.enum||e.oneOf);return this.isNothing(n)?this:(n=Array.isArray(n)?n:[n],this.addConstraint("notOneOf",{values:n}))},n.valErrMessage=function(t){return this.errorMessageHandler.valErrMessage(t)},n.createWhenConditionFor=function(t){return(this.config.createWhenCondition||S)({key:this.key,type:this.type,value:this.value,schema:this.schema,properties:this.properties,config:this.config,when:t})},n.label=function(){var t=this.value,e=t.title||t.label;return this.base=e&&this.base.label(e)||this.base,this},n.when=function(){var t,e=this.constraints.when;if((t=e)!==Object(t))return this;var n=this.createWhenConditionFor(e).constraint;return n?(this.logInfo("Adding when constraint for "+this.key,n),this.addConstraint("when",{values:n,errName:"when"}),this):(this.warn("Invalid when constraint for: "+e),this)},n.isType=function(){return this.addConstraint("isType",{value:this.constraints.isType,errName:"notOneOf"}),this},n.nullable=function(){var t=this.constraints;return this.addConstraint("nullable",{value:t.nullable||t.isNullable,errName:"notOneOf"}),this},n.message=function(){return config.messages[this.key]||config.messages[this.type]||{}},n.errMessage=function(t){return void 0===t&&(t="default"),this.message[t]||"error"},n.toValidJSONSchema=function(){},n.normalize=function(){},n.deNormalize=function(){},n.errorMsg=function(t){this.throwError(t)},n.error=function(t,e){var n=["["+t+"]",e].join(" ");this.errorMsg(n)},n.throwError=function(t){throw t},f(e,[{key:"customBaseValidator",get:function(){return this.config.validatorFor&&this.config.validatorFor(this.type)}},{key:"baseType",get:function(){return"mixed"}},{key:"validatorInstance",get:function(){return this.validator.mixed()}},{key:"mode",get:function(){return this.config.mode||{}}},{key:"disableFlags",get:function(){return[!1,"disabled","no","off"]}},{key:"enableFlags",get:function(){return[!0,"enabled","yes","on"]}},{key:"shouldPreProcessValue",get:function(){return!this.disabledMode("notRequired")}},{key:"value",get:function(){return this._value},set:function(t){this._value=this.preProcessedConstraintValue(t)}},{key:"mixedEnabled",get:function(){return this.mixedConfig.enabled||["oneOf","notOneOf","when","nullable","isType","label"]}},{key:"typeEnabled",get:function(){return[]}},{key:"$typeExtends",get:function(){if(Array.isArray(this.typeConfig.extends))return o.default([].concat(this.typeConfig.extends,this.typeEnabled))}},{key:"configuredTypeEnabled",get:function(){return Array.isArray(this.typeConfig.enabled)?this.typeConfig.enabled:this.typeEnabled}},{key:"$typeEnabled",get:function(){return this.$typeExtends||this.configuredTypeEnabled}},{key:"enabled",get:function(){return[].concat(this.mixedEnabled,this.$typeEnabled)}},{key:"constraintsMap",get:function(){return{simple:["required","notRequired","nullable"],value:["default","strict"]}}}]),e}(T),P=["oneOf","enum","required","notRequired","minDate","min","maxDate","max","trim","lowercase","uppercase","email","url","minLength","maxLength","pattern","matches","regex","integer","positive","minimum","maximum"],D={errMessages:function(t){return void 0===t&&(t=P),t.reduce(function(t,e){return t[e]=function(t){var e=t.value;return t.key+": invalid for "+(e.name||e.title)},t},{})}},R=/*#__PURE__*/function(t){function e(e){var n;return(n=t.call(this,e)||this).type=n.baseType,n.base=n.validatorInstance,n.createYupSchemaEntry=n.config.createYupSchemaEntry,n}p(e,t),e.create=function(t){return new e(t)};var n=e.prototype;return n.convert=function(){return t.prototype.convert.call(this),this},n.ensureItems=function(){return this.addConstraint("ensure")},n.compact=function(){return this.addConstraint("compact")},n.itemsOf=function(){var t=this.constraints,e=t.items||t.itemsOf||this.constraints.of;if(!this.isNothing(e))if(Array.isArray(e))this.error("itemsOf","does not (yet) support an Array of schemas");else if(this.isObjectType(e)){if(this.createYupSchemaEntry){try{var n=this.createYupSchemaEntry({key:this.key,value:e,config:this.config});return this.addConstraint("of",{constraintValue:n,propValue:e})}catch(t){this.error("itemsOf: Error",t)}return this}this.warn("missing createYupSchemaEntry in config, needed for recursive validation")}else this.error("itemsOf","must be a schema object, was "+typeof e)},n.maxItems=function(){var t=this.constraints,e=t.maxItems||t.max;if(!this.isNumberType(e))return this;if(!this.isValidSize(e))return this.handleInvalidSize("maxItems",e);var n=e&&this.base.max(e);return this.base=n||this.base,this},n.minItems=function(){var t=this.constraints,e=t.minItems||t.min;if(!this.isNumberType(e))return this;if(!this.isValidSize(e))return this.handleInvalidSize("minItems",e);var n=e&&this.base.min(e);return this.base=n||this.base,this},n.$items=function(){return this},n.$additionalItems=function(){return this},n.$uniqueItems=function(){return this},n.$contains=function(){return this},n.handleInvalidSize=function(t,e){var n="invalid array size constraint for "+t+", was "+e+". Must be a number >= 0";return this.config.warnOnInvalid?(this.warn(n),this):(this.error(n,e),this)},n.isValidSize=function(t){return this.isNumberType(t)&&t>=0},f(e,[{key:"baseType",get:function(){return"array"}},{key:"validatorInstance",get:function(){return this.validator.array()}},{key:"typeEnabled",get:function(){return["maxItems","minItems","ensureItems","compact","itemsOf"]}}]),e}(F),Y=/*#__PURE__*/function(t){function e(e){return t.call(this,e)||this}p(e,t);var n=e.prototype;return n.isArray=function(t){return this.config.isArray||this.error("ArrayHandler: mising isArray in config",this.config),this.config.isArray(t)},n.handle=function(t){return this.isArray(t)&&R.create(t).createSchemaEntry()},e}(T);function q(t,e){return void 0===e&&(e={}),t&&new Y(e).handle(t)}var H=/*#__PURE__*/function(t){function e(e){var n;return(n=t.call(this,e)||this).type=n.baseType,n.base=n.validatorInstance,n}return p(e,t),e.create=function(t){return new e(t)},f(e,[{key:"baseType",get:function(){return"boolean"}},{key:"validatorInstance",get:function(){return this.validator.boolean()}}]),e}(F),B=/*#__PURE__*/function(){function t(t){this.config=t}var e=t.prototype;return e.isBoolean=function(t){return this.config.isBoolean(t)},e.handle=function(t){return this.isBoolean(t)&&H.create(t).createSchemaEntry()},t}();function L(t,e){return void 0===e&&(e={}),t&&new B(e).handle(t)}var z=/*#__PURE__*/function(t){function e(e){return t.call(this,e)||this}return p(e,t),f(e,[{key:"$map",get:function(){return{moreThan:["exclusiveMinimum","moreThan"],lessThan:["exclusiveMaximum","lessThan"],max:["maximum","max"],min:["minimum","min"]}}}]),e}(/*#__PURE__*/function(t){function e(e){return t.call(this,e)||this}p(e,t);var n=e.prototype;return n.transform=function(t){return this.typer.toNumber(t)},n.isValidConstraint=function(t){return this.typer.isNumberLike(t)},f(e,[{key:"explainConstraintValidMsg",get:function(){return"Must be a number or convertible to a number"}}]),e}(/*#__PURE__*/function(t){function e(e,n){var r;return(r=t.call(this,e.config)||this).map=n||r.$map||{},r.typer=e,r.delegates.map(function(t){var n=e[t];n||r.error("missing delegate: "+t,{typer:e}),r[t]=r.isFunctionType(n)?n.bind(e):n}),r}p(e,t);var n=e.prototype;return n.isStringType=function(t){return"string"==typeof t},n.add=function(){var t=this,e=this.map;Object.keys(e).map(function(n){var r=t.entryNames(e[n]);t.addConstraints(n,r)})},n.entryNames=function(t){return Array.isArray(t)?t:[t]},n.addConstraints=function(t,e){var n=this;return void 0===e&&(e=[]),e.map(function(e){var r=n.validateAndTransform(e);n.addConstraint(e,{method:t,value:r})}),this},n.validateAndTransform=function(t){var e=this.constraints[t];return this.validate(e),this.transform(e)},n.invalidMsg=function(t,e){return"invalid constraint for "+t+", was "+e+"."},n.invalidConstraintMsg=function(t,e){return[this.invalidMsg(t,e),this.explainConstraintValidMsg].join("\n")},n.validate=function(t){return this.isNothing(t)?this:this.isValidConstraint(t)?void 0:this.handleInvalidConstraint(name,t)},n.isValidConstraint=function(t){return!0},n.handleInvalidConstraint=function(t,e){var n=this.invalidConstraintMsg(t,e);return this.config.warnOnInvalid?(this.warn(n),this):(this.error(n,e),this)},f(e,[{key:"delegates",get:function(){return["constraints","addConstraint","constraintsAdded"]}},{key:"explainConstraintValidMsg",get:function(){return""}}]),e}(E))),_=/*#__PURE__*/function(t){function e(e,n){return t.call(this,e,n)||this}return p(e,t),e.prototype.isValid=function(){return this.config.isNumber(this.obj)},e}(/*#__PURE__*/function(t){function e(e,n){var r;return(r=t.call(this,n)||this).obj=e,r}p(e,t);var n=e.prototype;return n.isValid=function(){return!1},n.verify=function(){return this.isPresent(this.obj)&&this.isValid(this.obj)},e}(T)),$=function(t,e){return void 0===e&&(e={}),function(t,e){return new _(t,e)}(t,e).verify()};function K(t,e){return void 0===e&&(e={}),$(t,e)&&function(t){return U.schemaEntryFor(t)}(t)}var U=/*#__PURE__*/function(t){function e(e){var n,r;return(n=t.call(this,e)||this).type=n.baseType,n.base=n.validatorInstance,n.rangeConstraint=(r=function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(n),new z(r)),n}p(e,t);var n=e.prototype;return n.normalizeNumType=function(t){return"int"===t?"integer":t},e.create=function(t){return new e(t)},e.schemaEntryFor=function(t){return e.create(t).createSchemaEntry()},n.convert=function(){return t.prototype.convert.call(this),this},n.range=function(){this.rangeConstraint.add()},n.truncate=function(){return this.addConstraint("truncate")},n.round=function(){var t=this.constraints.round;if(this.isNothing(t))return this;var e=this.isStringType(t)?t:"round";return t&&this.base.round(e),this},n.posNeg=function(){this.positive(),this.negative()},n.integer=function(){return this.isInteger&&this.addConstraint("integer"),this},n.positive=function(){return this.addConstraint("positive")},n.negative=function(){return this.addConstraint("negative")},n.normalize=function(){this.constraints.maximum=this.constraints.maximum||this.constraints.max,this.constraints.minimum=this.constraints.minimum||this.constraints.min},f(e,[{key:"baseType",get:function(){return this.normalizeNumType(this.opts.type)}},{key:"validatorInstance",get:function(){return this.validator.number()}},{key:"typeEnabled",get:function(){return["range","posNeg","integer"]}},{key:"isInteger",get:function(){return this.config.isInteger(this.type)}},{key:"isNegative",get:function(){var t=this.constraints,e=t.exclusiveMaximum;return!!t.negative||void 0!==e&&0===e}},{key:"isPositive",get:function(){var t=this.constraints,e=t.exclusiveMinimum;return!!t.positive||void 0!==e&&0===e}}]),e}(F),W=/*#__PURE__*/function(t){function e(e){var n;return(n=t.call(this,e)||this).type=n.baseType,n.base=n.validatorInstance,n.properties=n.value.properties,n}p(e,t),e.create=function(t){return new e(t)};var n=e.prototype;return n.convert=function(){if(!this.properties)return this;t.prototype.convert.call(this);var e=this.value,n=this.config;if(e){n.buildYup||this.error("convert","Missing buildYup function from config",n);var r=this.config.buildYup(e,n);this.base=r}return this},n.camelCase=function(){return this.addConstraint("camelCase")},n.constantCase=function(){return this.addConstraint("constantCase")},n.noUnknown=function(){var t=this.value,e=t.noUnknown||t.propertyNames,n=e&&this.base.noUnknown(e,this.valErrMessage("propertyNames")||this.valErrMessage("noUnknown"));return this.base=n||this.base,this},f(e,[{key:"baseType",get:function(){return"object"}},{key:"validatorInstance",get:function(){return this.validator.object()}},{key:"typeEnabled",get:function(){return["noUnknown","camelCase","constantCase"]}}]),e}(F),J=function(t){return t&&"object"===t.type},G=/*#__PURE__*/function(){function t(t){void 0===t&&(t={}),(t=t||{}).isObject=t.isObject||J,this.config=t,this.schema=t.schema}var e=t.prototype;return e.isObject=function(t){return this.config.isObject(t.value)},e.handle=function(t){return this.isObject(t)&&W.create(l({},t,{config:this.config})).createSchemaEntry()},t}();function Q(t,e){return void 0===e&&(e={}),t&&new G(e).handle(t)}var X=/*#__PURE__*/function(t){function e(e){var n;return(n=t.call(this,e)||this).type=n.baseType,n.base=n.validatorInstance,n}p(e,t),e.create=function(t){return new e(t)};var n=e.prototype;return n.convert=function(){return t.prototype.convert.call(this),this},n.trim=function(){return this.addConstraint("trim")},n.lowercase=function(){return this.addConstraint("lowercase")},n.uppercase=function(){return this.addConstraint("uppercase")},n.genericFormat=function(){1!=!this.config.format&&this.validator.prototype[this.format]&&this.addConstraint(this.format)},n.email=function(){if(!this.isEmail)return this;var t=this.constraintNameFor("email","format"),e="email";return this.addConstraint("email",{constraintValue:!0,constraintName:t,method:e,errName:e}),this},n.constraintNameFor=function(){var t=this;return[].slice.call(arguments).find(function(e){return t.constraints[e]})},n.url=function(){if(!this.isUrl)return this;var t=this.constraintNameFor("url","format");return this.addConstraint("url",{constraintValue:!0,constraintName:t,method:"url",errName:"url"}),this},n.minLength=function(){var t=this.constraints.minLength,e=this.valErrMessage("minLength")||this.valErrMessage("min"),n=t&&this.base.min(t,e);return this.base=n||this.base,this},n.maxLength=function(){var t=this.constraints.maxLength,e=this.valErrMessage("maxLength")||this.valErrMessage("max"),n=t&&this.base.max(t,e);return this.base=n||this.base,this},n.pattern=function(){var t=this.constraints,e=t.pattern;if(!e)return this;var n=new RegExp(e,t.flags),r=this.valErrMessage("pattern")||this.valErrMessage("matches")||this.valErrMessage("regex"),i=n&&this.base.matches(n,r);return this.base=i||this.base,this},n.normalize=function(){this.constraints.pattern=this.constraints.pattern||this.constraints.matches||this.constraints.regex,this.constraints.maxLength=this.constraints.maxLength||this.constraints.max,this.constraints.minLength=this.constraints.minLength||this.constraints.min},f(e,[{key:"baseType",get:function(){return"string"}},{key:"validatorInstance",get:function(){return this.validator.string()}},{key:"typeEnabled",get:function(){return["normalize","minLength","maxLength","pattern","lowercase","uppercase","email","url","genericFormat"]}},{key:"isEmail",get:function(){return this.constraints.email||"email"===this.format}},{key:"isUrl",get:function(){return this.constraints.url||"url"===this.format}}]),e}(F),Z=/*#__PURE__*/function(){function t(t){this.config=t}var e=t.prototype;return e.isString=function(t){return this.config.isString(t)},e.handle=function(t){return this.isString(t)&&X.create(l({config:this.config},t)).createSchemaEntry()},t}();function tt(t,e){return void 0===e&&(e={}),t&&new Z(e).handle(t)}var et=/*#__PURE__*/function(t){function e(e){var n;return(n=t.call(this,e)||this).type=n.baseType,n.base=n.validatorInstance,n}p(e,t),e.create=function(t){return new e(t)};var n=e.prototype;return n.convert=function(){return t.prototype.convert.call(this),this},n.toDate=function(t){return new Date(t)},n.isValidDateType=function(t){return this.isStringType(t)||this.isDateType(t)},n.isValidDate=function(t){return!!this.isValidDateType(t)&&(!this.isStringType(t)||Boolean(Date.parse(t)))},n.transformToDate=function(t){return this.isNumberType(t)?new Date(t):t},n.minDate=function(){var t=this.constraints.minDate||this.constraints.min;if(this.isNothing(t))return this;var e=this.transformToDate(t);if(!this.isValidDateType(e))return this.handleInvalidDate("minDate",e);var n=e&&this.base.min(this.toDate(e),this.valErrMessage("minDate")||this.valErrMessage("min"));return this.base=n||this.base,this},n.maxDate=function(){var t=this.constraints.maxDate||this.constraints.max;if(this.isNothing(t))return this;var e=this.transformToDate(t);if(!this.isValidDateType(e))return this.handleInvalidDate("maxDate",e);var n=e&&this.base.max(this.toDate(e),this.valErrMessage("maxDate")||this.valErrMessage("max"));return this.base=n||this.base,this},n.handleInvalidDate=function(t,e){var n="invalid constraint for "+t+", was "+e+". Must be a number, string (valid date format) or a Date instance";return this.config.warnOnInvalid?(this.warn(n),this):(this.error(n,e),this)},f(e,[{key:"baseType",get:function(){return"date"}},{key:"validatorInstance",get:function(){return this.validator.date()}},{key:"typeEnabled",get:function(){return["minDate","maxDate"]}}]),e}(F),nt=/*#__PURE__*/function(){function t(t){this.config=t}var e=t.prototype;return e.isDate=function(t){return this.config.isDate(t)},e.handle=function(t){return this.isDate(t)&&et.create(t).createSchemaEntry()},t}();function rt(t,e){return void 0===e&&(e={}),t&&new nt(e).handle(t)}var it={__proto__:null,errValKeys:P,defaults:D,YupArray:R,toYupArray:q,YupBoolean:H,toYupBoolean:L,YupNumber:U,toYupNumberSchemaEntry:K,toYupNumber:function(t,e){return void 0===e&&(e={}),$(t,e)&&function(t){return U.create(t)}(t)},YupObject:W,toYupObject:Q,YupString:X,toYupString:tt,YupDate:et,toYupDate:rt,YupMixed:F,ConvertYupSchemaError:I,Base:T},st=/*#__PURE__*/function(t){function e(){return t.apply(this,arguments)||this}return p(e,t),e}(/*#__PURE__*/g(Error)),at=/*#__PURE__*/function(t){function e(e,n){var r;r=t.call(this,n)||this;var i=e.value,s=e.type,a=e.kind,o=e.name,u=e.key,c=e.schema,h=e.types;return r.opts=e,r.kind=a,r.value=i,r.schema=c,r.key=u,r.value=i||{},r.name=o,r.type=s,r.types=h,r}p(e,t);var n=e.prototype;return n.error=function(t,e){var n,r,i=this.opts;throw e?(n=console).error.apply(n,[t,e].concat(i)):(r=console).error.apply(r,[t].concat(i)),new st(t)},n.resolve=function(){throw"Must be implemented by subclass"},f(e,[{key:"obj",get:function(){return{schema:this.schema,key:this.key,value:this.value,type:this.type,kind:this.kind,config:this.config}}}]),e}(T),ot=/*#__PURE__*/function(t){function e(e,n){return t.call(this,e,n)||this}return p(e,t),e.prototype.resolve=function(){if(Array.isArray(this.value)){var t=this.config.toMultiType;return t?t(this):void 0}},e}(at),ut=/*#__PURE__*/function(t){function e(e,n){return t.call(this,e,n)||this}return p(e,t),e.prototype.resolve=function(){if(!Array.isArray(this.value)){var t=this.config.toSingleType;if(t)return t(this);for(var e,n=this.obj,r=this.config,i=0,s=Object.keys(this.types);i<s.length;i++){var a=this.types[s[i]];if(a&&(e=a(n,r)),e)break}return e}},e}(at),ct=function(t,e,n){return new ht(t,e,n)},ht=/*#__PURE__*/function(t){function e(e,n){var r;return(r=t.call(this,e,n)||this).initResolvers(),r}p(e,t);var n=e.prototype;return n.initResolvers=function(){var t=this.opts,e=this.config,n=e.createMultiTypeResolver||this.createMultiTypeResolver.bind(this);this.multiTypeResolver=n(t,e);var r=e.createSingleTypeResolver||this.createSingleTypeResolver.bind(this);this.singleTypeResolver=r(t,e)},n.createMultiTypeResolver=function(){return new ot(this.opts,this.config)},n.createSingleTypeResolver=function(){return new ut(this.opts,this.config)},n.resolve=function(){return this.toMultiType()||this.toSingleType()||this.toDefaultEntry()},n.toMultiType=function(){return(this.config.toMultiType||this.singleTypeResolver.resolve.bind(this.singleTypeResolver))(this)},n.toSingleType=function(){return(this.config.toSingleType||this.singleTypeResolver.resolve.bind(this.singleTypeResolver))(this)},n.toDefaultEntry=function(){return this.defaultType()},n.defaultType=function(){this.error("toEntry: unknown type",this.type)},e}(at),ft=/*#__PURE__*/function(t){function e(){return t.apply(this,arguments)||this}return p(e,t),e}(/*#__PURE__*/g(Error)),lt=/*#__PURE__*/function(t){function e(e){var n;n=t.call(this,e.config)||this;var r=e.schema,i=e.name,s=e.key,a=e.value,o=e.config;n.builder=e.builder,n.opts=e,n.schema=r,n.key=s,n.value=a||{},n.config=o||{},n.name=i;var u=Array.isArray(a)?"array":a.type;return n.kind="array"===u?"multi":"single",n.type=u,n.setTypeHandlers(),n.setPropertyHandler(),n}p(e,t);var n=e.prototype;return n.setPropertyHandler=function(){var t=this.config;this.propertyValueHandler=(t.createPropertyValueHandler||this.createPropertyValueHandler)(this.propertyHandlerOpts,t)},n.createPropertyValueHandler=function(t,e){return ct(t,e)},n.setTypeHandlers=function(){this.types=this.config.types||this.typeHandlers},n.isValidSchema=function(){return this.isStringType(this.type)},n.error=function(t,e){var n,r,i=this.opts;throw e?(n=console).error.apply(n,[t,e].concat(i)):(r=console).error.apply(r,[t].concat(i)),new ft(t)},n.toEntry=function(){if(!this.isValidSchema()){var t=JSON.stringify(this.schema);this.error("Not a valid schema: type "+this.type+" must be a string, was "+typeof this.type+" "+t)}return this.propertyValueHandler.resolve(this.opts,this.config)},f(e,[{key:"propertyHandlerOpts",get:function(){return{type:this.type,kind:this.kind,types:this.types,value:this.value,name:this.name,key:this.key,schema:this.schema,entryHandler:this}}},{key:"defaultTypeHandlerMap",get:function(){return{string:tt,number:K,boolean:L,array:q,object:Q,date:rt}}},{key:"typeHandlers",get:function(){return l({},this.defaultTypeHandlerMap,this.config.typeHandlers||{})}}]),e}(T);function pt(t){return void 0===t&&(t={}),new lt(t).toEntry()}function dt(t,e){return void 0===e&&(e={}),new vt(t,l({},e)).yupSchema}function yt(t){return t===Object(t)}var vt=/*#__PURE__*/function(t){function e(e,n){var r;return void 0===n&&(n={}),(r=t.call(this,n)||this).init(e,n),r}p(e,t);var n=e.prototype;return n.init=function(t,e){e.buildYup=dt,e.createYupSchemaEntry=e.createYupSchemaEntry||pt,this.config=Object.assign(this.config,e),this.schema=t;var n=this.getType(t),r=this.getProps(t);if(this.type=n,this.properties=r,this.additionalProps=this.getAdditionalProperties(t),this.required=this.getRequired(t),this.setLocale(),("function"==typeof e.init?e.init:function(){}).bind(this)(t,e),function(t){return t&&"object"===t}(n))if(yt(r)){var i=this.getName(t),s=this.normalizeRequired(t),a=this.propsToShape({properties:s,name:i,config:e});this.shapeConfig=a,this.validSchema=!0}else{var o=JSON.stringify(s);this.error("invalid schema: must have a properties object: "+o)}else this.error('invalid schema: must be type: "object", was type: '+n)},n.setLocale=function(){this.config.locale&&a.setLocale(this.config.locale)},n.getAdditionalProperties=function(t){return t.additionalProperties},n.getRequired=function(t){var e=this.config.getRequired;return e?e(t):t.required||[]},n.getProps=function(t){return this.config.getProps(t)},n.getType=function(t){return this.config.getType(t)},n.getName=function(t){return this.config.getName(t)},n.normalizeRequired=function(){var t=this,e=l({},this.properties),n=[].concat(this.required)||[];return Object.keys(e).reduce(function(r,i){var s=e[i],a=n.indexOf(i)>=0;return yt(s)?s.required=t.isRequired(s)||a:t.warn("Bad value: "+s+" must be an object"),r[i]=s,r},{})},n.isRequired=function(t){return this.config.isRequired(t)},n.propsToShape=function(t){void 0===t&&(t={});var e=this.objPropsToShape(t);return this.objPropsShape=e,this.addPropsShape=this.additionalPropsToShape(t,e),e},n.additionalPropsToShape=function(t,e){return e},n.objPropsToShape=function(t){var e=this,n=t.name,r=l({},this.properties);return Object.keys(r).reduce(function(t,i){var s=e.propToYupSchemaEntry({name:n,key:i,value:r[i]});return e.logInfo("propsToShape",{key:i,yupSchemaEntry:s}),t[i]=s,t},{})},n.propToYupSchemaEntry=function(t){var e=t.value;return this.createYupSchemaEntry({schema:this.schema,name:t.name,key:t.key,value:void 0===e?{}:e,config:this.config,builder:this})},n.createYupSchemaEntry=function(t){return void 0===t&&(t={}),config.createYupSchemaEntry(t)},f(e,[{key:"yupSchema",get:function(){return a.object().shape(this.shapeConfig)}}]),e}(T),mt={alphanumeric:{optsKey:"locale"},alpha:{optsKey:"locale"},ascii:{},byte:{},creditCard:{},currency:{opts:"currencyOpts"},dataUri:{},dateTime:{},date:{},domainName:{opts:"domainOpts"},hash:{opts:"hashAlgo"},hexColor:{},ipv4:{},ipv6:{},isbn:{},magnetUri:{},mimeType:{},mobilePhone:{},mongoId:{},postalCode:{},uuid:{}},gt={createValidatorName:function(t,e){return"is"+(t=(t=c.default(t||e)).replace(/Uri$/,"URI")).replace(/Id$/,"ID")},createTestName:function(t,e){return u.default(t||e)}},bt={isMagnetURI:function(t,e){return/magnet:\?xt=urn:[a-z0-9]+:[a-z0-9]{32}/i.test(t)}};exports.ConstraintBuilder=V,exports.ErrorMessageHandler=A,exports.PropertyValueResolver=ht,exports.YupBuilder=vt,exports.YupSchemaEntry=lt,exports.YupSchemaEntryError=ft,exports.buildYup=dt,exports.createPropertyValueResolver=ct,exports.createYupSchemaEntry=pt,exports.extendYupApi=function(e){var n,r=this,i=void 0===e?{}:e,s=i.constraints,a=i.override,o=void 0!==a&&a,u=i.validator,c=i.createValidatorName,h=i.createTestName;if(!u)throw"extendYupApi: missing validator option";Array.isArray(s)&&(void 0===n&&(n={}),s=s.reduce(function(t,e){if("string"!=typeof e&&!(e instanceof Object)){if(!1!==n.throws)throw"toConstraintsMap: invalid entry "+e;return t}if("string"==typeof e)t[name]={};else{if(!e.name){if(!1!==n.throws)throw"toConstraintsMap: invalid entry "+e+" missing name";return t}t[e.name]=e}return t},{})),s=o?s||mt:l({},mt,s||{}),c=c||gt.createValidatorName,h=h||gt.createTestName,Object.keys(s).map(function(e){var n=s[e],i=n.testName,a=n.optsKey,o=n.logging,f=c(n.validatorName,e);i=h(i,e),t.addMethod(t.string,e,function(n){void 0===n&&(n={});var s=n.message,c=n[a];return t.string().test(i,s,function(t){var n=r.path,a=r.createError,h=u[f];if("function"!=typeof(h=h||bt[f]))throw Error("No method named ${validatorName} on validator");var l=h(t,c);return!0===o&&console.log("Yup validator bridge",{key:e,fullValidatorName:f,testName:i,value:t,valid:l}),l||a({path:n,message:s})})})})},exports.types=it;
var t=require("yup"),e=require("uniq"),n=require("dashify"),r=require("uppercamelcase");function i(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}function s(t){if(t&&t.__esModule)return t;var e=Object.create(null);return t&&Object.keys(t).forEach(function(n){if("default"!==n){var r=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,r.get?r:{enumerable:!0,get:function(){return t[n]}})}}),e.default=t,e}var a=/*#__PURE__*/s(t),o=/*#__PURE__*/i(e),u=/*#__PURE__*/i(n),c=/*#__PURE__*/i(r);function h(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function f(t,e,n){return e&&h(t.prototype,e),n&&h(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function l(){return l=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},l.apply(this,arguments)}function p(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,y(t,e)}function d(t){return d=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},d(t)}function y(t,e){return y=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},y(t,e)}function v(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}function m(t,e,n){return m=v()?Reflect.construct:function(t,e,n){var r=[null];r.push.apply(r,e);var i=new(Function.bind.apply(t,r));return n&&y(i,n.prototype),i},m.apply(null,arguments)}function g(t){var e="function"==typeof Map?new Map:void 0;return g=function(t){if(null===t||-1===Function.toString.call(t).indexOf("[native code]"))return t;if("function"!=typeof t)throw new TypeError("Super expression must either be null or a function");if(void 0!==e){if(e.has(t))return e.get(t);e.set(t,n)}function n(){return m(t,arguments,d(this).constructor)}return n.prototype=Object.create(t.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),y(n,t)},g(t)}var b={getProps:function(t){return t&&t.properties},getType:function(t){return t&&t.type},getName:function(t){return t&&(t.name||t.title)},getConstraints:function(t){return t},isString:function(t){return t&&"string"===t.type},isArray:function(t){return t&&"array"===t.type},isInteger:function(t){return t&&("integer"===t.type||"int"===t.type)},isBoolean:function(t){return t&&"boolean"===t.type},hasDateFormat:function(t){return t&&["date","date-time"].find(function(e){return e===t.format})},isDate:function(t){return t&&"string"===t.type&&b.hasDateFormat(t.format)},isNumber:function(t){return t&&("number"===t.type||b.isInteger(t))},isObject:function(t){return t&&"object"===t.type},isRequired:function(t){return t&&t.required}},w={getProps:function(t){return t.properties},getType:function(t){return t.type},getName:function(t){return t.name||t.title},getConstraints:function(t){return t},isString:function(t){return"string"===t.type&&!w.hasDateFormat(t)},isArray:function(t){return"array"===t.type},isBoolean:function(t){return"boolean"===t.type},isInteger:function(t){return"integer"===t.type},hasDateFormat:function(t){var e;return["date","date-time"].includes(null==t||null==(e=t.value)?void 0:e.format)},isDate:function(t){return"string"===t.type&&w.hasDateFormat(t)},isNumber:function(t){return"number"===t.type||w.isInteger(t)},isObject:function(t){return"object"===t.type},isRequired:function(t){return t.required}},k={getProps:function(t){return t&&t.fields},getType:function(t){return t&&t.type},getName:function(t){return t&&(t.name||t.title)},getConstraints:function(t){return t},isString:function(t){return t&&"string"===t.type},isArray:function(t){return t&&"array"===t.type},isInteger:function(t){return t&&"int"===t.type},isFloat:function(t){return t&&"float"===t.type},isDouble:function(t){return t&&"double"===t.type},isBoolean:function(t){return t&&"boolean"===t.type},isDate:function(t){return t&&"int"===t.type&&"date"===t.logicalType},isNumber:function(t){return t&&(k.isInteger(t)||k.isFloat(t)||k.isDouble(t))},isObject:function(t){return t&&"record"===t.type},isRequired:function(t){return t&&t.required}},C={"json-schema":b,"type-def":w,avro:k},E=/*#__PURE__*/function(t){function e(e){return void 0===e&&(e={}),t.call(this,e)||this}p(e,t);var n=e.prototype;return n.isNothing=function(t){return null==t},n.isPresent=function(t){return!this.isNothing(t)},n.toNumber=function(t){return Number(t)},n.isNumberLike=function(t){return!isNaN(this.toNumber(t))},n.isObjectType=function(t){return t===Object(t)},n.isArrayType=function(t){return Array.isArray(t)},n.isNumberType=function(t){return!isNaN(t)},n.isStringType=function(t){return"string"==typeof t},n.isFunctionType=function(t){return"function"==typeof t},n.isDateType=function(t){return t instanceof Date},e}(/*#__PURE__*/function(){function t(t){void 0===t&&(t={}),this.config=t;var e=t.log,n=t.error;this.enable=t.enable||{},this.log="function"==typeof e?e:console.log,this.err="function"==typeof n?n:console.error}var e=t.prototype;return e.error=function(t,e){if(!1!==this.enable.error)throw this.err&&(e?this.err(t,e):this.err(t)),t},e.warn=function(t,e){this.enable.warn&&this.logInfo("WARNING: "+t,e)},e.logInfo=function(t,e){this.enable.log&&this.log&&(e?this.log(t,e):this.log(t))},t}()),O=/*#__PURE__*/function(){function t(t,e){this.schemaParserMap=t,this.name=e}var e=t.prototype;return e.lookup=function(t){return void 0===t&&(t=this.name),this.schemaParserMap[t]},e.build=function(){var t=this.lookup();if(t.extends){var e=this.extend(t.extends);if(e)return e}return t},e.extend=function(t){var e=this.lookup(t);e&&(entry=l({},e,this.lookup()))},t}(),T=/*#__PURE__*/function(t){function e(e){var n;void 0===e&&(e={}),n=t.call(this,e)||this;var r=(e.createSchemaParserBuilder||new O(e.schemaParserMap||C,e.schemaType||"json-schema")).build();return n.config=l({},r,e),n}return p(e,t),e.prototype.createSchemaParserBuilder=function(t,e){return new SchemaParserBuilder(t,e)},e}(E);function M(t){return t===Object(t)}var N=/*#__PURE__*/function(){function t(t,e){void 0===e&&(e={}),this.whenEntryObj=t;var n=e.properties,r=e.config,i=e.key,s=e.when,a=e.type;this.schema=e.schema,this.when=s,this.properties=n||{},this.key=i,this.type=a,this.config=r}var e=t.prototype;return e.validateAndConfigure=function(t){if(!M(t=t||this.whenEntryObj))return this.warn("invalid or missing when entry constraint object",t),!1;var e=Object.keys(t);return e.length<2?(this.warn("validateAndConfigure: when entry constraint must have at least 2 keys: "+e,t),!1):this.hasKey(e,"is")?!!this.hasKey(e,"then")||(this.warn("validateAndConfigure: when entry constraint missing 'then' or 'else' constraint: "+e,t),!1):(this.warn("validateAndConfigure: when entry constraint missing 'is' constraint: "+e,t),!1)},e.createYupSchemaEntry=function(t){return this.config.createYupSchemaEntry(t)},e.createValue=function(t,e){var n;return"string"==typeof t&&((n={})[t]=!0,t=n),M(t)||this.error("createValue: "+e+" must be a schema object"),l({key:this.key,type:this.type},t)},e.createEntryOpts=function(t,e){var n=this.createValue(t,e);return{schema:this.schema,properties:this.properties,key:this.key,type:this.type,value:n,config:this.config}},e.createEntry=function(t,e){var n=this.createEntryOpts(t,e);return this.createYupSchemaEntry(n)},e.hasKey=function(t,e){return t.find(function(t){return t===e})},e.hasAnyKey=function(t,e){return t.find(function(t){return e.includes(t)})},e.whenEntryFor=function(t,e,n){var r;if(n=n||e,"string"==typeof t&&((r={})[t]=!0,t=r),!M(t))throw"whenEntryFor: Invalid when object "+t;var i=l({},t[n]);return delete t[n],i?(t[e]=this.createEntry(i,e),t):t},e.calcEntryObj=function(){var t=l({},this.whenEntryObj);return"otherwise"in(t=this.whenEntryFor(t,"then"))&&(t=this.whenEntryFor(t,"otherwise")),"else"in t&&(t=this.whenEntryFor(t,"else")),t},e.warn=function(t,e){console.error("[WhenEntry] WARNING",t,e)},e.error=function(t,e){throw console.error("[WhenEntry] ERROR",t,e),t},f(t,[{key:"entryObj",get:function(){return this.validateAndConfigure()&&this.calcEntryObj()}}]),t}();function x(t){return t===Object(t)}var j=/*#__PURE__*/function(){function t(t){void 0===t&&(t={});var e=t.type,n=t.key,r=t.value,i=t.when,s=t.schema,a=t.properties,o=t.config;this.opts=t,this.when=i,this.key=n,this.type=e,this.value=r,this.schema=s,this.properties=a,this.config=o,this.validate()}var e=t.prototype;return e.validate=function(){"string"!=typeof this.type&&this.error("validate: invalid or mising type: "+this.type,this.opts),x(this.when)||this.error("validate: invalid or mising when: "+this.when,this.opts)},e.validateAndConfigure=function(t){if(!x(t=t||this.when))return this.warn("invalid or missing when constraint",t),!1;var e=Object.keys(t);return e.length<1?(this.warn("when constraint must have at least 1 key: "+e,t),!1):(this.whenKeys=e,!0)},e.createWhenEntry=function(t,e){return function(t,e){return void 0===e&&(e={}),new N(t,e)}(t,e)},e.accumulate=function(t,e){var n=this.when[e];if(!x(n))return this.warn("invalid when entry constraint object "+n+" for "+e),t;var r=this.createWhenEntry(n,{type:this.type,key:this.key,schema:this.schema,properties:this.properties,config:this.config}).entryObj;return r?t=Object.assign(t,r):t},e.warn=function(t,e){console.error("[WhenCondition] WARNING",t,e)},e.error=function(t,e){throw console.error("[WhenCondition] ERROR",t,e),t},f(t,[{key:"constraintObj",get:function(){return this.whenKeys?this.whenKeys.reduce(this.accumulate.bind(this),{}):{}}},{key:"keyVal",get:function(){var t=this.whenKeys||[];return 1===t.length?t[0]:t}},{key:"constraintValue",get:function(){return!!this.keyVal&&[this.keyVal,this.constraintObj]}},{key:"constraint",get:function(){return this.validateAndConfigure()&&this.constraintValue}}]),t}(),S=function(t){return new j(t)},V=/*#__PURE__*/function(t){function e(e,n){var r;return void 0===n&&(n={}),(r=t.call(this,n)||this).typeHandler=e,r.constraintsAdded={},r.delegators.map(function(t){r[t]=e[t]}),r}p(e,t);var n=e.prototype;return n.build=function(t,e){void 0===e&&(e={});var n=e.constraintName,r=e.constraintValue,i=e.method,s=e.yup,a=e.value,o=e.values,u=e.errName;if(s=s||this.base,this.isNothing(r=r||e.propValue||this.constraints[t]))return this.warn("no prop value"),!1;n=n||t;var c=this.aliasMap[i=i||n]||i;if(!s[c])return this.warn("Yup has no such API method: "+c),!1;for(var h,f=s[c].bind(s),l=this.valErrMessage(n),p=u&&this.valErrMessage(u),d={constraintName:n,yup:s,constraintFn:f,errFn:l||p},y=0,v=["multiValueConstraint","presentConstraintValue","nonPresentConstraintValue"];y<v.length&&!(h=this[v[y]](a||o,d));y++);return h?(this.base=h,h):(this.warn("buildConstraint: missing value or values options"),!1)},n.nonPresentConstraintValue=function(t,e){var n=e.constraintName,r=e.constraintFn,i=e.errFn;if(!this.isPresent(t))return this.onConstraintAdded({name:n}),r(i)},n.presentConstraintValue=function(t,e){var n=e.constraintName,r=e.constraintFn,i=e.errFn;if(this.isPresent(t))return this.onConstraintAdded({name:n,value:t}),this.isNoValueConstraint(n)?r(i):r(t,i)},n.multiValueConstraint=function(t,e){var n=e.constraintFn,r=e.constraintName,i=e.errFn;if(this.isPresent(t)){if(Array.isArray(t))return this.onConstraintAdded({name:r,value:t}),this.callConstraintFn(n,r,t,i);this.warn("buildConstraint: values option must be an array of arguments")}},n.callConstraintFn=function(t,e,n,r){return this.isMultiArgsCall(e)?t.apply(void 0,n.concat([r])):t(n,r)},n.isMultiArgsCall=function(t){return this.multiArgsValidatorMethods[t]},n.isNoValueConstraint=function(t){return this.noValueConstraints.includes(t)},n.addValueConstraint=function(t,e){var n=void 0===e?{}:e;return this.addConstraint(t,{constraintName:n.constraintName,value:!0,errName:n.errName})},n.addConstraint=function(t,e){var n=this.build(t,e);return!!n&&(this.typeHandler.base=n,n)},n.onConstraintAdded=function(t){return this.constraintsAdded[t.name]=t.value,this.typeHandler},n.valErrMessage=function(t){return this.errorMessageHandler.valErrMessage(t)},f(e,[{key:"delegators",get:function(){return["errMessages","base","key","constraints","errorMessageHandler"]}},{key:"multiArgsValidatorMethods",get:function(){return this.config.multiArgsValidatorMethods||{when:!0}}},{key:"noValueConstraints",get:function(){return["required","email","url","format"]}},{key:"constraintsMap",get:function(){return{simple:["required","notRequired","nullable"],value:["default","strict"]}}},{key:"aliasMap",get:function(){return{oneOf:"oneOf",enum:"oneOf",anyOf:"oneOf"}}}]),e}(E),A=/*#__PURE__*/function(t){function e(e,n){var r;return void 0===n&&(n={}),(r=t.call(this,n)||this).typeHandler=e,r.constraints=e.constraints,r.errMessages=e.errMessages,r.key=e.key,r.type=e.type,r}p(e,t);var n=e.prototype;return n.valErrMessage=function(t){var e=this.constraints,n=this.errMessageFor(t);return"function"==typeof n?n(e):n},n.errMessageFor=function(t){var e=this.errMessages,n=e[this.key];return n?n[t]:e["$"+t]},e}(E),I=/*#__PURE__*/function(t){function e(){return t.apply(this,arguments)||this}return p(e,t),e}(/*#__PURE__*/g(Error)),F=/*#__PURE__*/function(t){function e(e){var n;return void 0===e&&(e={}),(n=t.call(this,e.config)||this).init(e),n}p(e,t);var n=e.prototype;return n.init=function(t){var e=t.schema,n=t.key,r=t.value,i=t.config,s=t.entryHandler;i=i||{},e=e||{},this.validateOnCreate(n,r,t),this.opts=t,this.entryHandler=s,this.validator=this.getValidator(),this.key=n,this.schema=e,this.properties=e.properties||{},this.value=r,this.constraints=this.getConstraints(),this.format=r.format||this.constraints.format,this.config=i||{},this.type=this.baseType,this.mixedConfig=this.config.mixedEnabled||{},this.typeConfig=this.config[this.type]||{},this.errMessages=i.errMessages||{},this.configureTypeConfig(),this.constraintsAdded={},this.base=this.getBase()},n.getBase=function(){return this.customBaseValidator||this.validatorInstance},n.getValidator=function(){return this.opts.validator||this.config.validator||this.entryHandler&&this.entryHandler.validator||a},n.configureTypeConfig=function(){this.typeConfig.enabled||this.typeConfig.extends||this.typeConfig.convert&&(this.typeConfig.extends=Object.keys(this.typeConfig.convert))},n.isRequired=function(t){return!0===(t=t||this.value).required},n.disabledMode=function(t){var e=this.mode[t];return!!this.disableFlags.find(function(t){return e===t})},n.enabledMode=function(t){var e=this.mode[t];return!!this.enableFlags.find(function(t){return e===t})},n.preProcessedConstraintValue=function(t){return this.shouldPreProcessValue?this.isRequired(t)?t:l({},t,{notRequired:!0}):t},n.initHelpers=function(){var t=this.config;this.errorMessageHandler=(this.config.createErrorMessageHandler||this.createErrorMessageHandler)(this,t),this.constraintBuilder=(this.config.createConstraintBuilder||this.createConstraintBuilder)(this,t),this.rebind("addConstraint","addValueConstraint")},n.createConstraintBuilder=function(t,e){return void 0===e&&(e={}),new V(t,e)},n.createErrorMessageHandler=function(t,e){return void 0===e&&(e={}),new A(t,e)},n.rebind=function(){var t=this;[].slice.call(arguments).map(function(e){var n=t[e];t[e]=t.isFunctionType(n)?n.bind(t):n})},n.validateOnCreate=function(t,e,n){t||this.error("create: missing key "+JSON.stringify(n)),e||this.error("create: missing value "+JSON.stringify(n))},n.convertEnabled=function(){var t=this;this.enabled.map(function(e){var n=t.convertFnFor(e);n&&n(t)})},n.convertFnFor=function(t){return this.customConvertFnFor(t,this)||this.builtInConvertFnFor(t)},n.customConvertFnFor=function(t){return(this.typeConfig.convert||{})[t]},n.builtInConvertFnFor=function(t){return this[t].bind(this)},n.getConstraints=function(){return this.config.getConstraints(this.value)},n.createSchemaEntry=function(){return this.convert().base},n.convert=function(){return this.initHelpers(),this.addMappedConstraints(),this.convertEnabled(),this},n.apply=function(t){var e,n=[].slice.call(arguments,1);if("string"!=typeof t)throw new TypeError("[Mixed] apply must take a method name available on the validator instance as first argument");return this.base=n&&n.length&&(e=this.base)[t].apply(e,n)||this.base,this},n.addValueConstraint=function(t,e){var n=this.constraintBuilder.addValueConstraint(t,e);return n&&(this.base=n.base),this},n.addConstraint=function(t,e){if(!this.constraintBuilder)throw new Error("[YupMixed] addConstraint: Missing constraintBuilder in "+this.constructor.name);var n=this.constraintBuilder.addConstraint(t,e);return n&&(this.base=n),this},n.addMappedConstraints=function(){var t=Object.keys(this.constraintsMap),e=this.addMappedConstraint.bind(this);return t.map(e),this},n.addMappedConstraint=function(t){var e=this["value"===t?"addValueConstraint":"addConstraint"];this.constraintsMap[t].map(function(t){e(t)})},n.oneOf=function(){var t=this,e=this.constraints.enum||this.constraints.oneOf||this.constraints.anyOf;if(this.isNothing(e))return this;e=Array.isArray(e)?e:[e];var n=["oneOf","enum","anyOf"].find(function(e){return void 0!==t.constraints[e]});return this.addConstraint(n,{values:e})},n.notOneOf=function(){var t=this.constraints,e=t.not,n=t.notOneOf||e&&(e.enum||e.oneOf);return this.isNothing(n)?this:(n=Array.isArray(n)?n:[n],this.addConstraint("notOneOf",{values:n}))},n.valErrMessage=function(t){return this.errorMessageHandler.valErrMessage(t)},n.createWhenConditionFor=function(t){return(this.config.createWhenCondition||S)({key:this.key,type:this.type,value:this.value,schema:this.schema,properties:this.properties,config:this.config,when:t})},n.label=function(){var t=this.value,e=t.title||t.label;return this.base=e&&this.base.label(e)||this.base,this},n.when=function(){var t,e=this.constraints.when;if((t=e)!==Object(t))return this;var n=this.createWhenConditionFor(e).constraint;return n?(this.logInfo("Adding when constraint for "+this.key,n),this.addConstraint("when",{values:n,errName:"when"}),this):(this.warn("Invalid when constraint for: "+e),this)},n.isType=function(){return this.addConstraint("isType",{value:this.constraints.isType,errName:"notOneOf"}),this},n.nullable=function(){var t=this.constraints;return this.addConstraint("nullable",{value:t.nullable||t.isNullable,errName:"notOneOf"}),this},n.message=function(){return config.messages[this.key]||config.messages[this.type]||{}},n.errMessage=function(t){return void 0===t&&(t="default"),this.message[t]||"error"},n.toValidJSONSchema=function(){},n.normalize=function(){},n.deNormalize=function(){},n.errorMsg=function(t){this.throwError(t)},n.error=function(t,e){var n=["["+t+"]",e].join(" ");this.errorMsg(n)},n.throwError=function(t){throw t},f(e,[{key:"customBaseValidator",get:function(){return this.config.validatorFor&&this.config.validatorFor(this.type)}},{key:"baseType",get:function(){return"mixed"}},{key:"validatorInstance",get:function(){return this.validator.mixed()}},{key:"mode",get:function(){return this.config.mode||{}}},{key:"disableFlags",get:function(){return[!1,"disabled","no","off"]}},{key:"enableFlags",get:function(){return[!0,"enabled","yes","on"]}},{key:"shouldPreProcessValue",get:function(){return!this.disabledMode("notRequired")}},{key:"value",get:function(){return this._value},set:function(t){this._value=this.preProcessedConstraintValue(t)}},{key:"mixedEnabled",get:function(){return this.mixedConfig.enabled||["oneOf","notOneOf","when","nullable","isType","label"]}},{key:"typeEnabled",get:function(){return[]}},{key:"$typeExtends",get:function(){if(Array.isArray(this.typeConfig.extends))return o.default([].concat(this.typeConfig.extends,this.typeEnabled))}},{key:"configuredTypeEnabled",get:function(){return Array.isArray(this.typeConfig.enabled)?this.typeConfig.enabled:this.typeEnabled}},{key:"$typeEnabled",get:function(){return this.$typeExtends||this.configuredTypeEnabled}},{key:"enabled",get:function(){return[].concat(this.mixedEnabled,this.$typeEnabled)}},{key:"constraintsMap",get:function(){return{simple:["required","notRequired","nullable"],value:["default","strict"]}}}]),e}(T),P=["oneOf","enum","required","notRequired","minDate","min","maxDate","max","trim","lowercase","uppercase","email","url","minLength","maxLength","pattern","matches","regex","integer","positive","minimum","maximum"],D={errMessages:function(t){return void 0===t&&(t=P),t.reduce(function(t,e){return t[e]=function(t){var e=t.value;return t.key+": invalid for "+(e.name||e.title)},t},{})}},R=/*#__PURE__*/function(t){function e(e){var n;return(n=t.call(this,e)||this).type=n.baseType,n.base=n.validatorInstance,n.createYupSchemaEntry=n.config.createYupSchemaEntry,n}p(e,t),e.create=function(t){return new e(t)};var n=e.prototype;return n.convert=function(){return t.prototype.convert.call(this),this},n.ensureItems=function(){return this.addConstraint("ensure")},n.compact=function(){return this.addConstraint("compact")},n.itemsOf=function(){var t=this.constraints,e=t.items||t.itemsOf||this.constraints.of;if(!this.isNothing(e))if(Array.isArray(e))this.error("itemsOf","does not (yet) support an Array of schemas");else if(this.isObjectType(e)){if(this.createYupSchemaEntry){try{var n=this.createYupSchemaEntry({key:this.key,value:e,config:this.config});return this.addConstraint("of",{constraintValue:n,propValue:e})}catch(t){this.error("itemsOf: Error",t)}return this}this.warn("missing createYupSchemaEntry in config, needed for recursive validation")}else this.error("itemsOf","must be a schema object, was "+typeof e)},n.maxItems=function(){var t=this.constraints,e=t.maxItems||t.max;if(!this.isNumberType(e))return this;if(!this.isValidSize(e))return this.handleInvalidSize("maxItems",e);var n=e&&this.base.max(e);return this.base=n||this.base,this},n.minItems=function(){var t=this.constraints,e=t.minItems||t.min;if(!this.isNumberType(e))return this;if(!this.isValidSize(e))return this.handleInvalidSize("minItems",e);var n=e&&this.base.min(e);return this.base=n||this.base,this},n.$items=function(){return this},n.$additionalItems=function(){return this},n.$uniqueItems=function(){return this},n.$contains=function(){return this},n.handleInvalidSize=function(t,e){var n="invalid array size constraint for "+t+", was "+e+". Must be a number >= 0";return this.config.warnOnInvalid?(this.warn(n),this):(this.error(n,e),this)},n.isValidSize=function(t){return this.isNumberType(t)&&t>=0},f(e,[{key:"baseType",get:function(){return"array"}},{key:"validatorInstance",get:function(){return this.validator.array()}},{key:"typeEnabled",get:function(){return["maxItems","minItems","ensureItems","compact","itemsOf"]}}]),e}(F),Y=/*#__PURE__*/function(t){function e(e){return t.call(this,e)||this}p(e,t);var n=e.prototype;return n.isArray=function(t){return this.config.isArray||this.error("ArrayHandler: mising isArray in config",this.config),this.config.isArray(t)},n.handle=function(t){return this.isArray(t)&&R.create(t).createSchemaEntry()},e}(T);function q(t,e){return void 0===e&&(e={}),t&&new Y(e).handle(t)}var H=/*#__PURE__*/function(t){function e(e){var n;return(n=t.call(this,e)||this).type=n.baseType,n.base=n.validatorInstance,n}return p(e,t),e.create=function(t){return new e(t)},f(e,[{key:"baseType",get:function(){return"boolean"}},{key:"validatorInstance",get:function(){return this.validator.boolean()}}]),e}(F),B=/*#__PURE__*/function(){function t(t){this.config=t}var e=t.prototype;return e.isBoolean=function(t){return this.config.isBoolean(t)},e.handle=function(t){return this.isBoolean(t)&&H.create(t).createSchemaEntry()},t}();function L(t,e){return void 0===e&&(e={}),t&&new B(e).handle(t)}var z=/*#__PURE__*/function(t){function e(e){return t.call(this,e)||this}return p(e,t),f(e,[{key:"$map",get:function(){return{moreThan:["exclusiveMinimum","moreThan"],lessThan:["exclusiveMaximum","lessThan"],max:["maximum","max"],min:["minimum","min"]}}}]),e}(/*#__PURE__*/function(t){function e(e){return t.call(this,e)||this}p(e,t);var n=e.prototype;return n.transform=function(t){return this.typer.toNumber(t)},n.isValidConstraint=function(t){return this.typer.isNumberLike(t)},f(e,[{key:"explainConstraintValidMsg",get:function(){return"Must be a number or convertible to a number"}}]),e}(/*#__PURE__*/function(t){function e(e,n){var r;return(r=t.call(this,e.config)||this).map=n||r.$map||{},r.typer=e,r.delegates.map(function(t){var n=e[t];n||r.error("missing delegate: "+t,{typer:e}),r[t]=r.isFunctionType(n)?n.bind(e):n}),r}p(e,t);var n=e.prototype;return n.isStringType=function(t){return"string"==typeof t},n.add=function(){var t=this,e=this.map;Object.keys(e).map(function(n){var r=t.entryNames(e[n]);t.addConstraints(n,r)})},n.entryNames=function(t){return Array.isArray(t)?t:[t]},n.addConstraints=function(t,e){var n=this;return void 0===e&&(e=[]),e.map(function(e){var r=n.validateAndTransform(e);n.addConstraint(e,{method:t,value:r})}),this},n.validateAndTransform=function(t){var e=this.constraints[t];return this.validate(e),this.transform(e)},n.invalidMsg=function(t,e){return"invalid constraint for "+t+", was "+e+"."},n.invalidConstraintMsg=function(t,e){return[this.invalidMsg(t,e),this.explainConstraintValidMsg].join("\n")},n.validate=function(t){return this.isNothing(t)?this:this.isValidConstraint(t)?void 0:this.handleInvalidConstraint(name,t)},n.isValidConstraint=function(t){return!0},n.handleInvalidConstraint=function(t,e){var n=this.invalidConstraintMsg(t,e);return this.config.warnOnInvalid?(this.warn(n),this):(this.error(n,e),this)},f(e,[{key:"delegates",get:function(){return["constraints","addConstraint","constraintsAdded"]}},{key:"explainConstraintValidMsg",get:function(){return""}}]),e}(E))),_=/*#__PURE__*/function(t){function e(e,n){return t.call(this,e,n)||this}return p(e,t),e.prototype.isValid=function(){return this.config.isNumber(this.obj)},e}(/*#__PURE__*/function(t){function e(e,n){var r;return(r=t.call(this,n)||this).obj=e,r}p(e,t);var n=e.prototype;return n.isValid=function(){return!1},n.verify=function(){return this.isPresent(this.obj)&&this.isValid(this.obj)},e}(T)),$=function(t,e){return void 0===e&&(e={}),function(t,e){return new _(t,e)}(t,e).verify()};function K(t,e){return void 0===e&&(e={}),$(t,e)&&function(t){return U.schemaEntryFor(t)}(t)}var U=/*#__PURE__*/function(t){function e(e){var n,r;return(n=t.call(this,e)||this).type=n.baseType,n.base=n.validatorInstance,n.rangeConstraint=(r=function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(n),new z(r)),n}p(e,t);var n=e.prototype;return n.normalizeNumType=function(t){return"int"===t?"integer":t},e.create=function(t){return new e(t)},e.schemaEntryFor=function(t){return e.create(t).createSchemaEntry()},n.convert=function(){return t.prototype.convert.call(this),this},n.range=function(){this.rangeConstraint.add()},n.truncate=function(){return this.addConstraint("truncate")},n.round=function(){var t=this.constraints.round;if(this.isNothing(t))return this;var e=this.isStringType(t)?t:"round";return t&&this.base.round(e),this},n.posNeg=function(){this.positive(),this.negative()},n.integer=function(){return this.isInteger&&this.addConstraint("integer"),this},n.positive=function(){return this.addConstraint("positive")},n.negative=function(){return this.addConstraint("negative")},n.normalize=function(){this.constraints.maximum=this.constraints.maximum||this.constraints.max,this.constraints.minimum=this.constraints.minimum||this.constraints.min},f(e,[{key:"baseType",get:function(){return this.normalizeNumType(this.opts.type)}},{key:"validatorInstance",get:function(){return this.validator.number()}},{key:"typeEnabled",get:function(){return["range","posNeg","integer"]}},{key:"isInteger",get:function(){return this.config.isInteger(this.type)}},{key:"isNegative",get:function(){var t=this.constraints,e=t.exclusiveMaximum;return!!t.negative||void 0!==e&&0===e}},{key:"isPositive",get:function(){var t=this.constraints,e=t.exclusiveMinimum;return!!t.positive||void 0!==e&&0===e}}]),e}(F),W=/*#__PURE__*/function(t){function e(e){var n;return(n=t.call(this,e)||this).type=n.baseType,n.base=n.validatorInstance,n.properties=n.value.properties,n}p(e,t),e.create=function(t){return new e(t)};var n=e.prototype;return n.convert=function(){if(!this.properties)return this;t.prototype.convert.call(this);var e=this.value,n=this.config;if(e){n.buildYup||this.error("convert","Missing buildYup function from config",n);var r=this.config.buildYup(e,n);this.base=r}return this},n.camelCase=function(){return this.addConstraint("camelCase")},n.constantCase=function(){return this.addConstraint("constantCase")},n.noUnknown=function(){var t=this.value,e=t.noUnknown||t.propertyNames,n=e&&this.base.noUnknown(e,this.valErrMessage("propertyNames")||this.valErrMessage("noUnknown"));return this.base=n||this.base,this},f(e,[{key:"baseType",get:function(){return"object"}},{key:"validatorInstance",get:function(){return this.validator.object()}},{key:"typeEnabled",get:function(){return["noUnknown","camelCase","constantCase"]}}]),e}(F),J=function(t){return t&&"object"===t.type},G=/*#__PURE__*/function(){function t(t){void 0===t&&(t={}),(t=t||{}).isObject=t.isObject||J,this.config=t,this.schema=t.schema}var e=t.prototype;return e.isObject=function(t){return this.config.isObject(t.value)},e.handle=function(t){return this.isObject(t)&&W.create(l({},t,{config:this.config})).createSchemaEntry()},t}();function Q(t,e){return void 0===e&&(e={}),t&&new G(e).handle(t)}var X=/*#__PURE__*/function(t){function e(e){var n;return(n=t.call(this,e)||this).type=n.baseType,n.base=n.validatorInstance,n}p(e,t),e.create=function(t){return new e(t)};var n=e.prototype;return n.convert=function(){return t.prototype.convert.call(this),this},n.trim=function(){return this.addConstraint("trim")},n.lowercase=function(){return this.addConstraint("lowercase")},n.uppercase=function(){return this.addConstraint("uppercase")},n.genericFormat=function(){1!=!this.config.format&&this.validator.prototype[this.format]&&this.addConstraint(this.format)},n.email=function(){if(!this.isEmail)return this;var t=this.constraintNameFor("email","format"),e="email";return this.addConstraint("email",{constraintValue:!0,constraintName:t,method:e,errName:e}),this},n.constraintNameFor=function(){var t=this;return[].slice.call(arguments).find(function(e){return t.constraints[e]})},n.url=function(){if(!this.isUrl)return this;var t=this.constraintNameFor("url","format");return this.addConstraint("url",{constraintValue:!0,constraintName:t,method:"url",errName:"url"}),this},n.minLength=function(){var t=this.constraints.minLength,e=this.valErrMessage("minLength")||this.valErrMessage("min"),n=t&&this.base.min(t,e);return this.base=n||this.base,this},n.maxLength=function(){var t=this.constraints.maxLength,e=this.valErrMessage("maxLength")||this.valErrMessage("max"),n=t&&this.base.max(t,e);return this.base=n||this.base,this},n.pattern=function(){var t=this.constraints,e=t.pattern;if(!e)return this;var n=new RegExp(e,t.flags),r=this.valErrMessage("pattern")||this.valErrMessage("matches")||this.valErrMessage("regex"),i=n&&this.base.matches(n,r);return this.base=i||this.base,this},n.normalize=function(){this.constraints.pattern=this.constraints.pattern||this.constraints.matches||this.constraints.regex,this.constraints.maxLength=this.constraints.maxLength||this.constraints.max,this.constraints.minLength=this.constraints.minLength||this.constraints.min},f(e,[{key:"baseType",get:function(){return"string"}},{key:"validatorInstance",get:function(){return this.validator.string()}},{key:"typeEnabled",get:function(){return["normalize","minLength","maxLength","pattern","lowercase","uppercase","email","url","genericFormat"]}},{key:"isEmail",get:function(){return this.constraints.email||"email"===this.format}},{key:"isUrl",get:function(){return this.constraints.url||"url"===this.format}}]),e}(F),Z=/*#__PURE__*/function(){function t(t){this.config=t}var e=t.prototype;return e.isString=function(t){return this.config.isString(t)},e.handle=function(t){return this.isString(t)&&X.create(l({config:this.config},t)).createSchemaEntry()},t}();function tt(t,e){return void 0===e&&(e={}),t&&new Z(e).handle(t)}var et=/*#__PURE__*/function(t){function e(e){var n;return(n=t.call(this,e)||this).type=n.baseType,n.base=n.validatorInstance,n}p(e,t),e.create=function(t){return new e(t)};var n=e.prototype;return n.convert=function(){return t.prototype.convert.call(this),this},n.toDate=function(t){return new Date(t)},n.isValidDateType=function(t){return this.isStringType(t)||this.isDateType(t)},n.isValidDate=function(t){return!!this.isValidDateType(t)&&(!this.isStringType(t)||Boolean(Date.parse(t)))},n.transformToDate=function(t){return this.isNumberType(t)?new Date(t):t},n.minDate=function(){var t=this.constraints.minDate||this.constraints.min;if(this.isNothing(t))return this;var e=this.transformToDate(t);if(!this.isValidDateType(e))return this.handleInvalidDate("minDate",e);var n=e&&this.base.min(this.toDate(e),this.valErrMessage("minDate")||this.valErrMessage("min"));return this.base=n||this.base,this},n.maxDate=function(){var t=this.constraints.maxDate||this.constraints.max;if(this.isNothing(t))return this;var e=this.transformToDate(t);if(!this.isValidDateType(e))return this.handleInvalidDate("maxDate",e);var n=e&&this.base.max(this.toDate(e),this.valErrMessage("maxDate")||this.valErrMessage("max"));return this.base=n||this.base,this},n.handleInvalidDate=function(t,e){var n="invalid constraint for "+t+", was "+e+". Must be a number, string (valid date format) or a Date instance";return this.config.warnOnInvalid?(this.warn(n),this):(this.error(n,e),this)},f(e,[{key:"baseType",get:function(){return"date"}},{key:"validatorInstance",get:function(){return this.validator.date()}},{key:"typeEnabled",get:function(){return["minDate","maxDate"]}}]),e}(F),nt=/*#__PURE__*/function(){function t(t){this.config=t}var e=t.prototype;return e.isDate=function(t){return this.config.isDate(t)},e.handle=function(t){return this.isDate(t)&&et.create(t).createSchemaEntry()},t}();function rt(t,e){return void 0===e&&(e={}),t&&new nt(e).handle(t)}var it={__proto__:null,errValKeys:P,defaults:D,YupArray:R,toYupArray:q,YupBoolean:H,toYupBoolean:L,YupNumber:U,toYupNumberSchemaEntry:K,toYupNumber:function(t,e){return void 0===e&&(e={}),$(t,e)&&function(t){return U.create(t)}(t)},YupObject:W,toYupObject:Q,YupString:X,toYupString:tt,YupDate:et,toYupDate:rt,YupMixed:F,ConvertYupSchemaError:I,Base:T},st=/*#__PURE__*/function(t){function e(){return t.apply(this,arguments)||this}return p(e,t),e}(/*#__PURE__*/g(Error)),at=/*#__PURE__*/function(t){function e(e,n){var r;r=t.call(this,n)||this;var i=e.value,s=e.type,a=e.kind,o=e.name,u=e.key,c=e.schema,h=e.types;return r.opts=e,r.kind=a,r.value=i,r.schema=c,r.key=u,r.value=i||{},r.name=o,r.type=s,r.types=h,r}p(e,t);var n=e.prototype;return n.error=function(t,e){var n,r,i=this.opts;throw e?(n=console).error.apply(n,[t,e].concat(i)):(r=console).error.apply(r,[t].concat(i)),new st(t)},n.resolve=function(){throw"Must be implemented by subclass"},f(e,[{key:"obj",get:function(){return{schema:this.schema,key:this.key,value:this.value,type:this.type,kind:this.kind,config:this.config}}}]),e}(T),ot=/*#__PURE__*/function(t){function e(e,n){return t.call(this,e,n)||this}return p(e,t),e.prototype.resolve=function(){if(Array.isArray(this.value)){var t=this.config.toMultiType;return t?t(this):void 0}},e}(at),ut=/*#__PURE__*/function(t){function e(e,n){return t.call(this,e,n)||this}return p(e,t),e.prototype.resolve=function(){if(!Array.isArray(this.value)){var t=this.config.toSingleType;if(t)return t(this);for(var e,n=this.obj,r=this.config,i=0,s=Object.keys(this.types);i<s.length;i++){var a=this.types[s[i]];if(a&&(e=a(n,r)),e)break}return e}},e}(at),ct=function(t,e,n){return new ht(t,e,n)},ht=/*#__PURE__*/function(t){function e(e,n){var r;return(r=t.call(this,e,n)||this).initResolvers(),r}p(e,t);var n=e.prototype;return n.initResolvers=function(){var t=this.opts,e=this.config,n=e.createMultiTypeResolver||this.createMultiTypeResolver.bind(this);this.multiTypeResolver=n(t,e);var r=e.createSingleTypeResolver||this.createSingleTypeResolver.bind(this);this.singleTypeResolver=r(t,e)},n.createMultiTypeResolver=function(){return new ot(this.opts,this.config)},n.createSingleTypeResolver=function(){return new ut(this.opts,this.config)},n.resolve=function(){return this.toMultiType()||this.toSingleType()||this.toDefaultEntry()},n.toMultiType=function(){return(this.config.toMultiType||this.singleTypeResolver.resolve.bind(this.singleTypeResolver))(this)},n.toSingleType=function(){return(this.config.toSingleType||this.singleTypeResolver.resolve.bind(this.singleTypeResolver))(this)},n.toDefaultEntry=function(){return this.defaultType()},n.defaultType=function(){this.error("toEntry: unknown type",this.type)},e}(at),ft=/*#__PURE__*/function(t){function e(){return t.apply(this,arguments)||this}return p(e,t),e}(/*#__PURE__*/g(Error)),lt=/*#__PURE__*/function(t){function e(e){var n;n=t.call(this,e.config)||this;var r=e.schema,i=e.name,s=e.key,a=e.value,o=e.config;n.builder=e.builder,n.opts=e,n.schema=r,n.key=s,n.value=a||{},n.config=o||{},n.name=i;var u=Array.isArray(a)?"array":a.type;return n.kind="array"===u?"multi":"single",n.type=u,n.setTypeHandlers(),n.setPropertyHandler(),n}p(e,t);var n=e.prototype;return n.setPropertyHandler=function(){var t=this.config;this.propertyValueHandler=(t.createPropertyValueHandler||this.createPropertyValueHandler)(this.propertyHandlerOpts,t)},n.createPropertyValueHandler=function(t,e){return ct(t,e)},n.setTypeHandlers=function(){this.types=this.config.types||this.typeHandlers},n.isValidSchema=function(){return this.isStringType(this.type)},n.error=function(t,e){var n,r,i=this.opts;throw e?(n=console).error.apply(n,[t,e].concat(i)):(r=console).error.apply(r,[t].concat(i)),new ft(t)},n.toEntry=function(){if(!this.isValidSchema()){var t=JSON.stringify(this.schema);this.error("Not a valid schema: type "+this.type+" must be a string, was "+typeof this.type+" "+t)}return this.propertyValueHandler.resolve(this.opts,this.config)},f(e,[{key:"validator",get:function(){return this.builder&&this.builder.validator}},{key:"propertyHandlerOpts",get:function(){return{type:this.type,kind:this.kind,types:this.types,value:this.value,name:this.name,key:this.key,schema:this.schema,entryHandler:this}}},{key:"defaultTypeHandlerMap",get:function(){return{string:tt,number:K,boolean:L,array:q,object:Q,date:rt}}},{key:"typeHandlers",get:function(){return l({},this.defaultTypeHandlerMap,this.config.typeHandlers||{})}}]),e}(T);function pt(t){return void 0===t&&(t={}),new lt(t).toEntry()}function dt(t,e){return void 0===e&&(e={}),new vt(t,l({},e)).yupSchema}function yt(t){return t===Object(t)}var vt=/*#__PURE__*/function(t){function e(e,n){var r;return void 0===n&&(n={}),(r=t.call(this,n)||this).init(e,n),r}p(e,t);var n=e.prototype;return n.init=function(t,e){e.buildYup=dt,e.createYupSchemaEntry=e.createYupSchemaEntry||pt,this.config=Object.assign(this.config,e),this.schema=t;var n=this.getType(t),r=this.getProps(t);if(this.type=n,this.properties=r,this.additionalProps=this.getAdditionalProperties(t),this.required=this.getRequired(t),this.setLocale(),("function"==typeof e.init?e.init:function(){}).bind(this)(t,e),function(t){return t&&"object"===t}(n))if(yt(r)){var i=this.getName(t),s=this.normalizeRequired(t),a=this.propsToShape({properties:s,name:i,config:e});this.shapeConfig=a,this.validSchema=!0}else{var o=JSON.stringify(s);this.error("invalid schema: must have a properties object: "+o)}else this.error('invalid schema: must be type: "object", was type: '+n)},n.setLocale=function(){this.config.locale&&a.setLocale(this.config.locale)},n.getAdditionalProperties=function(t){return t.additionalProperties},n.getRequired=function(t){var e=this.config.getRequired;return e?e(t):t.required||[]},n.getProps=function(t){return this.config.getProps(t)},n.getType=function(t){return this.config.getType(t)},n.getName=function(t){return this.config.getName(t)},n.normalizeRequired=function(){var t=this,e=l({},this.properties),n=[].concat(this.required)||[];return Object.keys(e).reduce(function(r,i){var s=e[i],a=n.indexOf(i)>=0;return yt(s)?s.required=t.isRequired(s)||a:t.warn("Bad value: "+s+" must be an object"),r[i]=s,r},{})},n.isRequired=function(t){return this.config.isRequired(t)},n.propsToShape=function(t){void 0===t&&(t={});var e=this.objPropsToShape(t);return this.objPropsShape=e,this.addPropsShape=this.additionalPropsToShape(t,e),e},n.additionalPropsToShape=function(t,e){return e},n.objPropsToShape=function(t){var e=this,n=t.name,r=l({},this.properties);return Object.keys(r).reduce(function(t,i){var s=e.propToYupSchemaEntry({name:n,key:i,value:r[i]});return e.logInfo("propsToShape",{key:i,yupSchemaEntry:s}),t[i]=s,t},{})},n.propToYupSchemaEntry=function(t){var e=t.value;return this.createYupSchemaEntry({schema:this.schema,name:t.name,key:t.key,value:void 0===e?{}:e,config:this.config,builder:this})},n.createYupSchemaEntry=function(t){return void 0===t&&(t={}),this.config.createYupSchemaEntry(t)},f(e,[{key:"validator",get:function(){return a}},{key:"yupSchema",get:function(){return a.object().shape(this.shapeConfig)}}]),e}(T),mt={alphanumeric:{optsKey:"locale"},alpha:{optsKey:"locale"},ascii:{},byte:{},creditCard:{},currency:{opts:"currencyOpts"},dataUri:{},dateTime:{},date:{},domainName:{opts:"domainOpts"},hash:{opts:"hashAlgo"},hexColor:{},ipv4:{},ipv6:{},isbn:{},magnetUri:{},mimeType:{},mobilePhone:{},mongoId:{},postalCode:{},uuid:{}},gt={createValidatorName:function(t,e){return"is"+(t=(t=c.default(t||e)).replace(/Uri$/,"URI")).replace(/Id$/,"ID")},createTestName:function(t,e){return u.default(t||e)}},bt={isMagnetURI:function(t,e){return/magnet:\?xt=urn:[a-z0-9]+:[a-z0-9]{32}/i.test(t)}};exports.ConstraintBuilder=V,exports.ErrorMessageHandler=A,exports.PropertyValueResolver=ht,exports.YupBuilder=vt,exports.YupSchemaEntry=lt,exports.YupSchemaEntryError=ft,exports.buildYup=dt,exports.createPropertyValueResolver=ct,exports.createYupSchemaEntry=pt,exports.extendYupApi=function(e){var n,r=this,i=void 0===e?{}:e,s=i.constraints,a=i.override,o=void 0!==a&&a,u=i.validator,c=i.createValidatorName,h=i.createTestName;if(!u)throw"extendYupApi: missing validator option";Array.isArray(s)&&(void 0===n&&(n={}),s=s.reduce(function(t,e){if("string"!=typeof e&&!(e instanceof Object)){if(!1!==n.throws)throw"toConstraintsMap: invalid entry "+e;return t}if("string"==typeof e)t[name]={};else{if(!e.name){if(!1!==n.throws)throw"toConstraintsMap: invalid entry "+e+" missing name";return t}t[e.name]=e}return t},{})),s=o?s||mt:l({},mt,s||{}),c=c||gt.createValidatorName,h=h||gt.createTestName,Object.keys(s).map(function(e){var n=s[e],i=n.testName,a=n.optsKey,o=n.logging,f=c(n.validatorName,e);i=h(i,e),t.addMethod(t.string,e,function(n){void 0===n&&(n={});var s=n.message,c=n[a];return t.string().test(i,s,function(t){var n=r.path,a=r.createError,h=u[f];if("function"!=typeof(h=h||bt[f]))throw Error("No method named ${validatorName} on validator");var l=h(t,c);return!0===o&&console.log("Yup validator bridge",{key:e,fullValidatorName:f,testName:i,value:t,valid:l}),l||a({path:n,message:s})})})})},exports.types=it;
//# sourceMappingURL=index.js.map
{
"name": "schema-to-yup",
"version": "1.11.1",
"version": "1.11.2",
"publishConfig": {

@@ -5,0 +5,0 @@ "access": "public"

@@ -610,8 +610,13 @@ # Schema to Yup schema

```js
const validatorSingleton = new MyValidator()
class MyCustomBuilder extends YupBuilder {
init(schema, config)
super.init(schema, config)
this.validator = new MyValidator()
}
get validator() {
return validatorSingleton
}
get yupSchema() {

@@ -625,3 +630,3 @@ return this.validator.buildSchema();

So you can access a `validator` instance set in the builder via `this.entryHandler.builder.validator` (note: the validator should normally be a singleton instance)
So you can access a `validator` instance set in the builder via `this.entryHandler.validator` (note: should normally be a singleton instance)

@@ -628,0 +633,0 @@ Then do futher customisations as needed.

@@ -33,2 +33,6 @@ import {

get validator() {
return this.builder && this.builder.validator
}
setPropertyHandler() {

@@ -35,0 +39,0 @@ const { config } = this

@@ -61,2 +61,6 @@ import * as yup from "yup";

get validator() {
return yup
}
setLocale() {

@@ -163,4 +167,4 @@ this.config.locale && yup.setLocale(this.config.locale);

createYupSchemaEntry(opts = {}) {
return config.createYupSchemaEntry(opts);
return this.config.createYupSchemaEntry(opts);
}
}

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

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

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc