( iss: errors.$ZodRawIssue, ctx: schemas.ParseContextInternal | undefined, config: $ZodConfig )
| 847 | } |
| 848 | |
| 849 | export function finalizeIssue( |
| 850 | iss: errors.$ZodRawIssue, |
| 851 | ctx: schemas.ParseContextInternal | undefined, |
| 852 | config: $ZodConfig |
| 853 | ): errors.$ZodIssue { |
| 854 | const message = iss.message |
| 855 | ? iss.message |
| 856 | : (unwrapMessage(iss.inst?._zod.def?.error?.(iss as never)) ?? |
| 857 | unwrapMessage(ctx?.error?.(iss as never)) ?? |
| 858 | unwrapMessage(config.customError?.(iss)) ?? |
| 859 | unwrapMessage(config.localeError?.(iss)) ?? |
| 860 | "Invalid input"); |
| 861 | |
| 862 | const { inst: _inst, continue: _continue, input: _input, ...rest } = iss as any; |
| 863 | rest.path ??= []; |
| 864 | rest.message = message; |
| 865 | if (ctx?.reportInput) { |
| 866 | rest.input = _input; |
| 867 | } |
| 868 | return rest; |
| 869 | } |
| 870 | |
| 871 | export function getSizableOrigin(input: any): "set" | "map" | "file" | "unknown" { |
| 872 | if (input instanceof Set) return "set"; |
nothing calls this directly
no test coverage detected