(str: string)
| 32 | |
| 33 | // Helper to parse YAML string to object |
| 34 | const parseYamlParams = (str: string): Record<string, unknown> | null => { |
| 35 | if (!str.trim()) return {}; |
| 36 | try { |
| 37 | const parsed = yaml.load(str); |
| 38 | if (typeof parsed === 'object' && parsed !== null) { |
| 39 | // Convert null values to empty strings to preserve keys |
| 40 | const result: Record<string, unknown> = {}; |
| 41 | for (const [key, value] of Object.entries(parsed as Record<string, unknown>)) { |
| 42 | result[key] = value === null || value === undefined ? '' : value; |
| 43 | } |
| 44 | return result; |
| 45 | } |
| 46 | return null; |
| 47 | } catch { |
| 48 | return null; |
| 49 | } |
| 50 | }; |
| 51 | |
| 52 | // YAML Parameters Editor with local state for smooth editing |
| 53 | function YamlParamsEditor({ |
no outgoing calls
no test coverage detected