Favivon - Correção

This commit is contained in:
2026-05-30 19:59:39 -03:00
parent 76ddaa815d
commit d7dfd221f0
32859 changed files with 5459654 additions and 404 deletions
+1
View File
@@ -0,0 +1 @@
export * from './zod';
+49
View File
@@ -0,0 +1,49 @@
import { FieldValues, Resolver } from 'react-hook-form';
import * as z3 from 'zod/v3';
import * as z4 from 'zod/v4/core';
type RawResolverOptions = {
mode?: 'async' | 'sync';
raw: true;
};
type NonRawResolverOptions = {
mode?: 'async' | 'sync';
raw?: false;
};
interface Zod3Type<O = unknown, I = unknown> {
_output: O;
_input: I;
_def: {
typeName: string;
};
}
type IsUnresolved<T> = PropertyKey extends keyof T ? true : false;
type UnresolvedFallback<T, Fallback> = IsUnresolved<typeof z3> extends true ? Fallback : T;
type FallbackIssue = {
code: string;
message: string;
path: (string | number)[];
};
type Zod3ParseParams = UnresolvedFallback<z3.ParseParams, {
path?: (string | number)[];
errorMap?: (iss: FallbackIssue, ctx: {
defaultError: string;
data: any;
}) => {
message: string;
};
async?: boolean;
}>;
type Zod4ParseParams = UnresolvedFallback<z4.ParseContext<z4.$ZodIssue>, {
readonly error?: (iss: FallbackIssue) => null | undefined | string | {
message: string;
};
readonly reportInput?: boolean;
readonly jitless?: boolean;
}>;
export declare function zodResolver<Input extends FieldValues, Context, Output>(schema: Zod3Type<Output, Input>, schemaOptions?: Zod3ParseParams, resolverOptions?: NonRawResolverOptions): Resolver<Input, Context, Output>;
export declare function zodResolver<Input extends FieldValues, Context, Output>(schema: Zod3Type<Output, Input>, schemaOptions: Zod3ParseParams | undefined, resolverOptions: RawResolverOptions): Resolver<Input, Context, Input>;
export declare function zodResolver<Input extends FieldValues, Context, Output, T extends z4.$ZodType<Output, Input> = z4.$ZodType<Output, Input>>(schema: T, schemaOptions?: Zod4ParseParams, // already partial
resolverOptions?: NonRawResolverOptions): Resolver<z4.input<T>, Context, z4.output<T>>;
export declare function zodResolver<Input extends FieldValues, Context, Output, T extends z4.$ZodType<Output, Input> = z4.$ZodType<Output, Input>>(schema: z4.$ZodType<Output, Input>, schemaOptions: Zod4ParseParams | undefined, // already partial
resolverOptions: RawResolverOptions): Resolver<z4.input<T>, Context, z4.input<T>>;
export {};
+2
View File
@@ -0,0 +1,2 @@
var r=require("@hookform/resolvers"),e=require("react-hook-form");function n(r){if(r&&r.__esModule)return r;var e=Object.create(null);return r&&Object.keys(r).forEach(function(n){if("default"!==n){var o=Object.getOwnPropertyDescriptor(r,n);Object.defineProperty(e,n,o.get?o:{enumerable:!0,get:function(){return r[n]}})}}),e.default=r,e}var o=/*#__PURE__*/n(require("zod/v4/core"));function t(r,e){try{var n=r()}catch(r){return e(r)}return n&&n.then?n.then(void 0,e):n}function s(r,n){for(var o={};r.length;){var t=r[0],s=t.code,i=t.message,a=t.path.join(".");if(!o[a])if("unionErrors"in t){var u=t.unionErrors[0].errors[0];o[a]={message:u.message,type:u.code}}else o[a]={message:i,type:s};if("unionErrors"in t&&t.unionErrors.forEach(function(e){return e.errors.forEach(function(e){return r.push(e)})}),n){var c=o[a].types,f=c&&c[t.code];o[a]=e.appendErrors(a,n,o,s,f?[].concat(f,t.message):t.message)}r.shift()}return o}function i(r,n){for(var o={};r.length;){var t=r[0],s=t.code,i=t.message,a=t.path.join(".");if(!o[a])if("invalid_union"===t.code&&t.errors.length>0){var u=t.errors[0][0];o[a]={message:u.message,type:u.code}}else o[a]={message:i,type:s};if("invalid_union"===t.code&&t.errors.forEach(function(e){return e.forEach(function(e){return r.push(e)})}),n){var c=o[a].types,f=c&&c[t.code];o[a]=e.appendErrors(a,n,o,s,f?[].concat(f,t.message):t.message)}r.shift()}return o}exports.zodResolver=function(e,n,a){if(void 0===a&&(a={}),function(r){return"_def"in r&&"object"==typeof r._def&&"typeName"in r._def}(e))return function(o,i,u){try{return Promise.resolve(t(function(){return Promise.resolve(e["sync"===a.mode?"parse":"parseAsync"](o,n)).then(function(e){return u.shouldUseNativeValidation&&r.validateFieldsNatively({},u),{errors:{},values:a.raw?Object.assign({},o):e}})},function(e){if(function(r){return Array.isArray(null==r?void 0:r.issues)}(e))return{values:{},errors:r.toNestErrors(s(e.errors,!u.shouldUseNativeValidation&&"all"===u.criteriaMode),u)};throw e}))}catch(r){return Promise.reject(r)}};if(function(r){return"_zod"in r&&"object"==typeof r._zod}(e))return function(s,u,c){try{return Promise.resolve(t(function(){return Promise.resolve(("sync"===a.mode?o.parse:o.parseAsync)(e,s,n)).then(function(e){return c.shouldUseNativeValidation&&r.validateFieldsNatively({},c),{errors:{},values:a.raw?Object.assign({},s):e}})},function(e){if(function(r){return r instanceof o.$ZodError}(e))return{values:{},errors:r.toNestErrors(i(e.issues,!c.shouldUseNativeValidation&&"all"===c.criteriaMode),c)};throw e}))}catch(r){return Promise.reject(r)}};throw new Error("Invalid input: not a Zod schema")};
//# sourceMappingURL=zod.js.map
File diff suppressed because one or more lines are too long
+2
View File
@@ -0,0 +1,2 @@
import{validateFieldsNatively as r,toNestErrors as e}from"@hookform/resolvers";import{appendErrors as o}from"react-hook-form";import*as n from"zod/v4/core";function t(r,e){try{var o=r()}catch(r){return e(r)}return o&&o.then?o.then(void 0,e):o}function s(r,e){for(var n={};r.length;){var t=r[0],s=t.code,i=t.message,a=t.path.join(".");if(!n[a])if("unionErrors"in t){var u=t.unionErrors[0].errors[0];n[a]={message:u.message,type:u.code}}else n[a]={message:i,type:s};if("unionErrors"in t&&t.unionErrors.forEach(function(e){return e.errors.forEach(function(e){return r.push(e)})}),e){var c=n[a].types,f=c&&c[t.code];n[a]=o(a,e,n,s,f?[].concat(f,t.message):t.message)}r.shift()}return n}function i(r,e){for(var n={};r.length;){var t=r[0],s=t.code,i=t.message,a=t.path.join(".");if(!n[a])if("invalid_union"===t.code&&t.errors.length>0){var u=t.errors[0][0];n[a]={message:u.message,type:u.code}}else n[a]={message:i,type:s};if("invalid_union"===t.code&&t.errors.forEach(function(e){return e.forEach(function(e){return r.push(e)})}),e){var c=n[a].types,f=c&&c[t.code];n[a]=o(a,e,n,s,f?[].concat(f,t.message):t.message)}r.shift()}return n}function a(o,a,u){if(void 0===u&&(u={}),function(r){return"_def"in r&&"object"==typeof r._def&&"typeName"in r._def}(o))return function(n,i,c){try{return Promise.resolve(t(function(){return Promise.resolve(o["sync"===u.mode?"parse":"parseAsync"](n,a)).then(function(e){return c.shouldUseNativeValidation&&r({},c),{errors:{},values:u.raw?Object.assign({},n):e}})},function(r){if(function(r){return Array.isArray(null==r?void 0:r.issues)}(r))return{values:{},errors:e(s(r.errors,!c.shouldUseNativeValidation&&"all"===c.criteriaMode),c)};throw r}))}catch(r){return Promise.reject(r)}};if(function(r){return"_zod"in r&&"object"==typeof r._zod}(o))return function(s,c,f){try{return Promise.resolve(t(function(){return Promise.resolve(("sync"===u.mode?n.parse:n.parseAsync)(o,s,a)).then(function(e){return f.shouldUseNativeValidation&&r({},f),{errors:{},values:u.raw?Object.assign({},s):e}})},function(r){if(function(r){return r instanceof n.$ZodError}(r))return{values:{},errors:e(i(r.issues,!f.shouldUseNativeValidation&&"all"===f.criteriaMode),f)};throw r}))}catch(r){return Promise.reject(r)}};throw new Error("Invalid input: not a Zod schema")}export{a as zodResolver};
//# sourceMappingURL=zod.module.js.map
+2
View File
@@ -0,0 +1,2 @@
import{validateFieldsNatively as e,toNestErrors as r}from"@hookform/resolvers";import{appendErrors as o}from"react-hook-form";import*as s from"zod/v4/core";function t(e,r){const s={};for(;e.length;){const t=e[0],{code:n,message:a,path:i}=t,c=i.join(".");if(!s[c])if("unionErrors"in t){const e=t.unionErrors[0].errors[0];s[c]={message:e.message,type:e.code}}else s[c]={message:a,type:n};if("unionErrors"in t&&t.unionErrors.forEach(r=>r.errors.forEach(r=>e.push(r))),r){const e=s[c].types,a=e&&e[t.code];s[c]=o(c,r,s,n,a?[].concat(a,t.message):t.message)}e.shift()}return s}function n(e,r){const s={};for(;e.length;){const t=e[0],{code:n,message:a,path:i}=t,c=i.join(".");if(!s[c])if("invalid_union"===t.code&&t.errors.length>0){const e=t.errors[0][0];s[c]={message:e.message,type:e.code}}else s[c]={message:a,type:n};if("invalid_union"===t.code&&t.errors.forEach(r=>r.forEach(r=>e.push(r))),r){const e=s[c].types,a=e&&e[t.code];s[c]=o(c,r,s,n,a?[].concat(a,t.message):t.message)}e.shift()}return s}function a(o,a,i={}){if((e=>"_def"in e&&"object"==typeof e._def&&"typeName"in e._def)(o))return async(s,n,c)=>{try{const r=await o["sync"===i.mode?"parse":"parseAsync"](s,a);return c.shouldUseNativeValidation&&e({},c),{errors:{},values:i.raw?Object.assign({},s):r}}catch(e){if((e=>Array.isArray(null==e?void 0:e.issues))(e))return{values:{},errors:r(t(e.errors,!c.shouldUseNativeValidation&&"all"===c.criteriaMode),c)};throw e}};if((e=>"_zod"in e&&"object"==typeof e._zod)(o))return async(t,c,d)=>{try{const r="sync"===i.mode?s.parse:s.parseAsync,n=await r(o,t,a);return d.shouldUseNativeValidation&&e({},d),{errors:{},values:i.raw?Object.assign({},t):n}}catch(e){if((e=>e instanceof s.$ZodError)(e))return{values:{},errors:r(n(e.issues,!d.shouldUseNativeValidation&&"all"===d.criteriaMode),d)};throw e}};throw new Error("Invalid input: not a Zod schema")}export{a as zodResolver};
//# sourceMappingURL=zod.modern.mjs.map
File diff suppressed because one or more lines are too long
+2
View File
@@ -0,0 +1,2 @@
import{validateFieldsNatively as r,toNestErrors as e}from"@hookform/resolvers";import{appendErrors as o}from"react-hook-form";import*as n from"zod/v4/core";function t(r,e){try{var o=r()}catch(r){return e(r)}return o&&o.then?o.then(void 0,e):o}function s(r,e){for(var n={};r.length;){var t=r[0],s=t.code,i=t.message,a=t.path.join(".");if(!n[a])if("unionErrors"in t){var u=t.unionErrors[0].errors[0];n[a]={message:u.message,type:u.code}}else n[a]={message:i,type:s};if("unionErrors"in t&&t.unionErrors.forEach(function(e){return e.errors.forEach(function(e){return r.push(e)})}),e){var c=n[a].types,f=c&&c[t.code];n[a]=o(a,e,n,s,f?[].concat(f,t.message):t.message)}r.shift()}return n}function i(r,e){for(var n={};r.length;){var t=r[0],s=t.code,i=t.message,a=t.path.join(".");if(!n[a])if("invalid_union"===t.code&&t.errors.length>0){var u=t.errors[0][0];n[a]={message:u.message,type:u.code}}else n[a]={message:i,type:s};if("invalid_union"===t.code&&t.errors.forEach(function(e){return e.forEach(function(e){return r.push(e)})}),e){var c=n[a].types,f=c&&c[t.code];n[a]=o(a,e,n,s,f?[].concat(f,t.message):t.message)}r.shift()}return n}function a(o,a,u){if(void 0===u&&(u={}),function(r){return"_def"in r&&"object"==typeof r._def&&"typeName"in r._def}(o))return function(n,i,c){try{return Promise.resolve(t(function(){return Promise.resolve(o["sync"===u.mode?"parse":"parseAsync"](n,a)).then(function(e){return c.shouldUseNativeValidation&&r({},c),{errors:{},values:u.raw?Object.assign({},n):e}})},function(r){if(function(r){return Array.isArray(null==r?void 0:r.issues)}(r))return{values:{},errors:e(s(r.errors,!c.shouldUseNativeValidation&&"all"===c.criteriaMode),c)};throw r}))}catch(r){return Promise.reject(r)}};if(function(r){return"_zod"in r&&"object"==typeof r._zod}(o))return function(s,c,f){try{return Promise.resolve(t(function(){return Promise.resolve(("sync"===u.mode?n.parse:n.parseAsync)(o,s,a)).then(function(e){return f.shouldUseNativeValidation&&r({},f),{errors:{},values:u.raw?Object.assign({},s):e}})},function(r){if(function(r){return r instanceof n.$ZodError}(r))return{values:{},errors:e(i(r.issues,!f.shouldUseNativeValidation&&"all"===f.criteriaMode),f)};throw r}))}catch(r){return Promise.reject(r)}};throw new Error("Invalid input: not a Zod schema")}export{a as zodResolver};
//# sourceMappingURL=zod.module.js.map
File diff suppressed because one or more lines are too long
+2
View File
@@ -0,0 +1,2 @@
!function(e,r){"object"==typeof exports&&"undefined"!=typeof module?r(exports,require("@hookform/resolvers"),require("react-hook-form"),require("zod/v4/core")):"function"==typeof define&&define.amd?define(["exports","@hookform/resolvers","react-hook-form","zod/v4/core"],r):r((e||self).hookformResolversZod={},e.hookformResolvers,e.ReactHookForm,e.z4)}(this,function(e,r,o,n){function t(e){if(e&&e.__esModule)return e;var r=Object.create(null);return e&&Object.keys(e).forEach(function(o){if("default"!==o){var n=Object.getOwnPropertyDescriptor(e,o);Object.defineProperty(r,o,n.get?n:{enumerable:!0,get:function(){return e[o]}})}}),r.default=e,r}var s=/*#__PURE__*/t(n);function i(e,r){try{var o=e()}catch(e){return r(e)}return o&&o.then?o.then(void 0,r):o}function a(e,r){for(var n={};e.length;){var t=e[0],s=t.code,i=t.message,a=t.path.join(".");if(!n[a])if("unionErrors"in t){var u=t.unionErrors[0].errors[0];n[a]={message:u.message,type:u.code}}else n[a]={message:i,type:s};if("unionErrors"in t&&t.unionErrors.forEach(function(r){return r.errors.forEach(function(r){return e.push(r)})}),r){var c=n[a].types,f=c&&c[t.code];n[a]=o.appendErrors(a,r,n,s,f?[].concat(f,t.message):t.message)}e.shift()}return n}function u(e,r){for(var n={};e.length;){var t=e[0],s=t.code,i=t.message,a=t.path.join(".");if(!n[a])if("invalid_union"===t.code&&t.errors.length>0){var u=t.errors[0][0];n[a]={message:u.message,type:u.code}}else n[a]={message:i,type:s};if("invalid_union"===t.code&&t.errors.forEach(function(r){return r.forEach(function(r){return e.push(r)})}),r){var c=n[a].types,f=c&&c[t.code];n[a]=o.appendErrors(a,r,n,s,f?[].concat(f,t.message):t.message)}e.shift()}return n}e.zodResolver=function(e,o,n){if(void 0===n&&(n={}),function(e){return"_def"in e&&"object"==typeof e._def&&"typeName"in e._def}(e))return function(t,s,u){try{return Promise.resolve(i(function(){return Promise.resolve(e["sync"===n.mode?"parse":"parseAsync"](t,o)).then(function(e){return u.shouldUseNativeValidation&&r.validateFieldsNatively({},u),{errors:{},values:n.raw?Object.assign({},t):e}})},function(e){if(function(e){return Array.isArray(null==e?void 0:e.issues)}(e))return{values:{},errors:r.toNestErrors(a(e.errors,!u.shouldUseNativeValidation&&"all"===u.criteriaMode),u)};throw e}))}catch(e){return Promise.reject(e)}};if(function(e){return"_zod"in e&&"object"==typeof e._zod}(e))return function(t,a,c){try{return Promise.resolve(i(function(){return Promise.resolve(("sync"===n.mode?s.parse:s.parseAsync)(e,t,o)).then(function(e){return c.shouldUseNativeValidation&&r.validateFieldsNatively({},c),{errors:{},values:n.raw?Object.assign({},t):e}})},function(e){if(function(e){return e instanceof s.$ZodError}(e))return{values:{},errors:r.toNestErrors(u(e.issues,!c.shouldUseNativeValidation&&"all"===c.criteriaMode),c)};throw e}))}catch(e){return Promise.reject(e)}};throw new Error("Invalid input: not a Zod schema")}});
//# sourceMappingURL=zod.umd.js.map
File diff suppressed because one or more lines are too long