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

Function getArrayFieldValues

packages/core/src/forms/internal/arrayState.ts:30–39  ·  view source on GitHub ↗
(
  values: T,
  field: K,
)

Source from the content-addressed store, hash-verified

28type CounterRef = { current: number };
29
30export function getArrayFieldValues<T extends Record<string, unknown>, K extends ArrayFieldName<T>>(
31 values: T,
32 field: K,
33): Array<ArrayFieldItem<T, K>> {
34 const raw = values[field];
35 if (!Array.isArray(raw)) {
36 return [];
37 }
38 return [...(raw as Array<ArrayFieldItem<T, K>>)];
39}
40
41function removeAtIndex<TValue>(value: ReadonlyArray<TValue>, index: number): TValue[] {
42 const next = [...value];

Callers 4

useFieldArrayFunction · 0.85
appendFunction · 0.85
removeFunction · 0.85
moveFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected