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

Function runSyncValidation

packages/core/src/forms/validation.ts:22–30  ·  view source on GitHub ↗
(
  values: T,
  validate: ((values: T) => ValidationResult<T>) | undefined,
)

Source from the content-addressed store, hash-verified

20 * @returns Errors object with field keys and error messages
21 */
22export function runSyncValidation<T extends Record<string, unknown>>(
23 values: T,
24 validate: ((values: T) => ValidationResult<T>) | undefined,
25): ValidationResult<T> {
26 if (!validate) {
27 return {};
28 }
29 return validate(values);
30}
31
32/**
33 * Execute field-level validation from a form validator.

Callers 3

useForm.test.tsFile · 0.85

Calls 1

validateFunction · 0.50

Tested by

no test coverage detected