MCPcopy Create free account
hub / github.com/RtlZeroMemory/Rezi / isValidationClean

Function isValidationClean

packages/core/src/forms/validation.ts:73–94  ·  view source on GitHub ↗
(
  errors: ValidationResult<T>,
)

Source from the content-addressed store, hash-verified

71 * @returns True if there are no errors
72 */
73export function isValidationClean<T extends Record<string, unknown>>(
74 errors: ValidationResult<T>,
75): boolean {
76 const keys = Object.keys(errors) as (keyof T)[];
77 for (const key of keys) {
78 const value = errors[key];
79 if (value === undefined || value === "") {
80 continue;
81 }
82
83 if (typeof value === "string") {
84 return false;
85 }
86
87 for (const item of value) {
88 if (item !== undefined && item !== "") {
89 return false;
90 }
91 }
92 }
93 return true;
94}
95
96/**
97 * Create a debounced async validation runner.

Callers 5

useFormFunction · 0.85
createSubmitActionFunction · 0.85
resolveWizardTransitionFunction · 0.85
useForm.test.tsFile · 0.85

Calls 1

keysMethod · 0.65

Tested by

no test coverage detected