MCPcopy Create free account
hub / github.com/colbymchenry/codegraph / service

Function service

__tests__/drupal-services.test.ts:389–392  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

387 const cg = CodeGraph.initSync(dir);
388 await cg.indexAll();
389 const service = (): string[] => {
390 const node = cg.getNodesByName('service:shop.cart').find((n) => n.kind === 'component')!;
391 return cg.getOutgoingEdges(node.id).filter((e) => e.kind === 'references').map((e) => cg.getNode(e.target)!.name);
392 };
393 expect(service()).toEqual([]);
394
395 write('src/Cart.php', '<?php\nnamespace Drupal\\shop;\nclass Cart {}\n');

Callers 1

Calls 4

mapMethod · 0.80
getNodeMethod · 0.80
getNodesByNameMethod · 0.65
getOutgoingEdgesMethod · 0.45

Tested by

no test coverage detected