(text: string, tasks: Record<string, unknown>)
| 48 | * Throws on malformed input so the caller can refuse the save without clobbering the file. |
| 49 | */ |
| 50 | export function patchDreamerTasksJsonc(text: string, tasks: Record<string, unknown>): string { |
| 51 | const root = parseRoot(text); |
| 52 | const dreamer = isRecord(root.dreamer) ? root.dreamer : {}; |
| 53 | root.dreamer = dreamer; |
| 54 | dreamer.tasks = tasks; |
| 55 | return stringifyJsonc(root); |
| 56 | } |
| 57 | |
| 58 | /** Remove the project-level dreamer override while preserving the rest of the config file. */ |
| 59 | export function removeDreamerBlockJsonc(text: string): string { |
no test coverage detected