(path: str)
| 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 |
nothing calls this directly
no outgoing calls
no test coverage detected