* Build a name → definition map from the AST (deduplicated — first wins).
(ast)
| 443 | * Build a name → definition map from the AST (deduplicated — first wins). |
| 444 | */ |
| 445 | function buildDefMap(ast) { |
| 446 | const map = new Map() |
| 447 | for (const def of ast) { |
| 448 | if (def.Name && !map.has(def.Name)) map.set(def.Name, def) |
| 449 | } |
| 450 | return map |
| 451 | } |
| 452 | |
| 453 | /** Extract {domain, methodStr, operationName, paramsCddl} from a command/event leaf def. */ |
| 454 | function parseLeafDef(def) { |
no test coverage detected