* Which of `nodes` carry a decorator: their own outgoing `decorates` edge, an * unresolved `decorates` row (the only trace a decorator imported from outside * the index, like `@HostListener` or `@Cron`, leaves), or the `decorators` * list a couple of languages record on the node itself.
(cg: CodeGraph, nodes: readonly Node[])
| 965 | * list a couple of languages record on the node itself. |
| 966 | */ |
| 967 | function carriesDecorator(cg: CodeGraph, nodes: readonly Node[]): Set<string> { |
| 968 | const ids = nodes.map((node) => node.id); |
| 969 | const found = new Set(cg.getOutgoingEdgesFrom(ids, ['decorates']).map((edge) => edge.source)); |
| 970 | for (const id of cg.getUnresolvedReferenceNamesFrom(ids, ['decorates']).keys()) found.add(id); |
| 971 | for (const node of nodes) if ((node.decorators?.length ?? 0) > 0) found.add(node.id); |
| 972 | return found; |
| 973 | } |
| 974 | |
| 975 | /** |
| 976 | * Which members are hooks their framework calls by name — the ids to drop. |
no test coverage detected