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

Function _js_dispatch_value_idents

graphify/extract.py:1736–1751  ·  view source on GitHub ↗

Yield identifier value-nodes of a JS/TS object/array literal that are function-reference candidates: object property VALUES and shorthand properties (`{ handler }`), and array elements. Keys and inline methods are not references.

(coll_node)

Source from the content-addressed store, hash-verified

1734
1735
1736def _js_dispatch_value_idents(coll_node):
1737 """Yield identifier value-nodes of a JS/TS object/array literal that are
1738 function-reference candidates: object property VALUES and shorthand properties
1739 (`{ handler }`), and array elements. Keys and inline methods are not references."""
1740 if coll_node.type == "object":
1741 for c in coll_node.children:
1742 if c.type == "pair":
1743 val = c.child_by_field_name("value")
1744 if val is not None and val.type == "identifier":
1745 yield val
1746 elif c.type == "shorthand_property_identifier":
1747 yield c
1748 else: # array
1749 for el in coll_node.children:
1750 if el.type == "identifier":
1751 yield el
1752
1753
1754def _resolve_name(node, source: bytes, config: LanguageConfig) -> str | None:

Callers 2

walk_callsFunction · 0.85
_scan_js_module_dispatchFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected