Unwrap { value, componentType } wrapper from form field entries. Returns raw value.
(v: unknown)
| 25 | |
| 26 | /** Unwrap { value, componentType } wrapper from form field entries. Returns raw value. */ |
| 27 | function unwrapFieldValue(v: unknown): unknown { |
| 28 | if ( |
| 29 | v && |
| 30 | typeof v === "object" && |
| 31 | !Array.isArray(v) && |
| 32 | "value" in (v as Record<string, unknown>) |
| 33 | ) { |
| 34 | return (v as Record<string, unknown>).value; |
| 35 | } |
| 36 | return v; |
| 37 | } |
| 38 | |
| 39 | export interface UseOpenUIStateOptions { |
| 40 | response: string | null; |