* Build a name → definition map from the AST (deduplicated — first wins).
(ast)
| 499 | * Build a name → definition map from the AST (deduplicated — first wins). |
| 500 | */ |
| 501 | function buildDefMap(ast) { |
| 502 | const map = new Map() |
| 503 | for (const def of ast) { |
| 504 | if (def.Name && !map.has(def.Name)) map.set(def.Name, def) |
| 505 | } |
| 506 | return map |
| 507 | } |
| 508 | |
| 509 | /** Extract {domain, methodStr, operationName, paramsCddl} from a command/event leaf def. */ |
| 510 | function parseLeafDef(def) { |
no test coverage detected