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

Function remapFieldArrayErrors

packages/core/src/forms/internal/arrayState.ts:123–132  ·  view source on GitHub ↗
(
  fieldError: FieldErrorValue | undefined,
  size: number,
  map: (currentErrors: Array<string | undefined>) => Array<string | undefined>,
)

Source from the content-addressed store, hash-verified

121}
122
123function remapFieldArrayErrors(
124 fieldError: FieldErrorValue | undefined,
125 size: number,
126 map: (currentErrors: Array<string | undefined>) => Array<string | undefined>,
127): FieldErrorValue {
128 if (typeof fieldError === "string") {
129 return fieldError;
130 }
131 return map(normalizeErrorArray(fieldError, size));
132}
133
134export function createFieldArrayApi<T extends Record<string, unknown>>(options: {
135 state: FormState<T>;

Callers 3

appendFunction · 0.85
removeFunction · 0.85
moveFunction · 0.85

Calls 1

normalizeErrorArrayFunction · 0.85

Tested by

no test coverage detected