(modulePath: string)
| 28 | |
| 29 | // Resolve module content by path: node overrides > global modulesByPath (with normalization) |
| 30 | function resolveContent(modulePath: string): string | undefined { |
| 31 | if (nodeOverrides[modulePath]) return nodeOverrides[modulePath]; |
| 32 | |
| 33 | // Direct lookup |
| 34 | if (modulesByPath[modulePath]) return modulesByPath[modulePath].content; |
| 35 | |
| 36 | // Normalize: strip leading ./ |
| 37 | const stripped = modulePath.replace(/^\.\//, ''); |
| 38 | if (modulesByPath[stripped]) return modulesByPath[stripped].content; |
| 39 | |
| 40 | // Strip workflows/ prefix |
| 41 | const noPrefix = stripped.replace(/^workflows\//, ''); |
| 42 | if (modulesByPath[noPrefix]) return modulesByPath[noPrefix].content; |
| 43 | |
| 44 | // Suffix match: find any key ending with the path |
| 45 | const keys = Object.keys(modulesByPath); |
| 46 | const suffixMatch = keys.find( |
| 47 | (k) => k.endsWith('/' + stripped) || k.endsWith('/' + noPrefix), |
| 48 | ); |
| 49 | if (suffixMatch) return modulesByPath[suffixMatch].content; |
| 50 | |
| 51 | return undefined; |
| 52 | } |
| 53 | |
| 54 | // Extract module paths from a list of workflow steps |
| 55 | function extractModulePaths(steps: WorkflowStep[]): string[] { |
no outgoing calls
no test coverage detected