Function
removeFieldArrayKey
(
field: keyof T,
index: number,
fieldArrayKeysRef: FieldArrayKeysRef<T>,
)
Source from the content-addressed store, hash-verified
| 90 | } |
| 91 | |
| 92 | function removeFieldArrayKey<T extends Record<string, unknown>>( |
| 93 | field: keyof T, |
| 94 | index: number, |
| 95 | fieldArrayKeysRef: FieldArrayKeysRef<T>, |
| 96 | ): void { |
| 97 | const existing = [...(fieldArrayKeysRef.current[field] ?? [])]; |
| 98 | if (index < 0 || index >= existing.length) { |
| 99 | return; |
| 100 | } |
| 101 | existing.splice(index, 1); |
| 102 | fieldArrayKeysRef.current[field] = existing; |
| 103 | } |
| 104 | |
| 105 | function moveFieldArrayKey<T extends Record<string, unknown>>( |
| 106 | field: keyof T, |
Tested by
no test coverage detected