(yamlContent: string)
| 140 | |
| 141 | // Recursively process a YAML string |
| 142 | function process(yamlContent: string) { |
| 143 | let parsed: unknown; |
| 144 | try { |
| 145 | parsed = yamlLib.load(yamlContent); |
| 146 | } catch { |
| 147 | return; |
| 148 | } |
| 149 | if (!parsed || typeof parsed !== 'object') return; |
| 150 | const workflow = (parsed as Record<string, unknown>).workflow; |
| 151 | if (!Array.isArray(workflow)) return; |
| 152 | |
| 153 | const paths = extractModulePaths(workflow as WorkflowStep[]); |
| 154 | for (const p of paths) { |
| 155 | if (visited.has(p)) continue; |
| 156 | visited.add(p); |
| 157 | const content = resolveContent(p); |
| 158 | if (content) { |
| 159 | result.set(p, content); |
| 160 | // Recurse into this module's YAML |
| 161 | process(content); |
| 162 | } |
| 163 | } |
| 164 | } |
| 165 | |
| 166 | // Start with the main YAML |
| 167 | process(mainYaml); |
no test coverage detected