MCPcopy Create free account
hub / github.com/CodeGraphContext/CodeGraphContext / _is_path_key

Function _is_path_key

src/codegraphcontext/server.py:61–69  ·  view source on GitHub ↗

Check if a dict key represents a file path field. Matches keys like 'path', 'clone_path', 'caller_file_path', and also Cypher-aliased keys like 'f.path', 'n.caller_file_path'.

(key: str)

Source from the content-addressed store, hash-verified

59
60
61def _is_path_key(key: str) -> bool:
62 """Check if a dict key represents a file path field.
63
64 Matches keys like 'path', 'clone_path', 'caller_file_path', and also
65 Cypher-aliased keys like 'f.path', 'n.caller_file_path'.
66 """
67 # Strip Cypher alias prefix (e.g. "f.path" -> "path")
68 bare = key.rsplit(".", 1)[-1] if "." in key else key
69 return bare == "path" or bare.endswith("_path")
70
71
72def _strip_path_value(value):

Callers 1

_strip_workspace_prefixFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected