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

Function normalizeErrorArray

packages/core/src/forms/internal/state.ts:186–199  ·  view source on GitHub ↗
(
  value: FieldErrorValue | undefined,
  size: number,
)

Source from the content-addressed store, hash-verified

184}
185
186export function normalizeErrorArray(
187 value: FieldErrorValue | undefined,
188 size: number,
189): Array<string | undefined> {
190 if (Array.isArray(value)) {
191 const next = value.slice(0, size);
192 while (next.length < size) {
193 next.push(undefined);
194 }
195 return next;
196 }
197
198 return Array.from({ length: size }, () => undefined);
199}
200
201export function resolveFieldOverride<T extends Record<string, unknown>>(
202 field: keyof T,

Callers 1

remapFieldArrayErrorsFunction · 0.85

Calls 1

pushMethod · 0.45

Tested by

no test coverage detected