MCPcopy Create free account
hub / github.com/vercel/examples / _dir

Function _dir

python/vibe-coding-ide/backend/src/agent/utils.py:188–197  ·  view source on GitHub ↗
(path: str)

Source from the content-addressed store, hash-verified

186 directory = pattern[:-1].lstrip("/")
187
188 def _dir(path: str) -> bool:
189 n = (path or "").lstrip("/")
190 if not directory:
191 return False
192 if "/" in directory:
193 # anchored subpath: match exact or prefix (e.g., "frontend/node_modules/")
194 return n == directory or n.startswith(directory + "/")
195 # segment match anywhere (e.g., any "node_modules" segment in the path)
196 parts = n.split("/") if n else []
197 return directory in parts
198
199 return _dir
200

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected