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

Function extract_js

graphify/extract.py:5861–5872  ·  view source on GitHub ↗

Extract classes, functions, arrow functions, and imports from a .js/.ts/.tsx/.mts/.cts file.

(path: Path)

Source from the content-addressed store, hash-verified

5859
5860
5861def extract_js(path: Path) -> dict:
5862 """Extract classes, functions, arrow functions, and imports from a .js/.ts/.tsx/.mts/.cts file."""
5863 if path.suffix == ".tsx":
5864 config = _TSX_CONFIG
5865 elif path.suffix in (".ts", ".mts", ".cts"):
5866 config = _TS_CONFIG
5867 else:
5868 config = _JS_CONFIG
5869 result = _extract_generic(path, config)
5870 if "error" not in result:
5871 _extract_js_rationale(path, result)
5872 return result
5873
5874
5875# ── JS/TS rationale + doc-reference extraction ────────────────────────────────

Calls 2

_extract_genericFunction · 0.85
_extract_js_rationaleFunction · 0.85