MCPcopy Create free account
hub / github.com/Graphify-Labs/graphify / _method_edges

Function _method_edges

tests/test_ts_object_alias_methods.py:10–22  ·  view source on GitHub ↗
(path: Path, source: str)

Source from the content-addressed store, hash-verified

8
9
10def _method_edges(path: Path, source: str) -> set[tuple[str, str, str]]:
11 path.write_text(source, encoding="utf-8")
12 result = extract_js(path)
13 nodes = {node["id"]: node for node in result["nodes"]}
14 methods = set()
15 for edge in result["edges"]:
16 if edge["relation"] == "method":
17 owner = nodes[edge["source"]]
18 method = nodes[edge["target"]]
19 assert Path(method["source_file"]) == path
20 assert edge["source_location"] == method["source_location"]
21 methods.add((owner["label"], method["label"], method["source_location"]))
22 return methods
23
24
25@pytest.mark.parametrize("suffix", [".ts", ".tsx"])

Calls 1

extract_jsFunction · 0.90

Tested by

no test coverage detected