(paths: List[str])
| 47 | |
| 48 | |
| 49 | def _common_root(paths: List[str]) -> str: |
| 50 | if not paths: |
| 51 | return "" |
| 52 | parts = [Path(p).parent.parts for p in paths if isinstance(p, str) and p] |
| 53 | if not parts: |
| 54 | return "" |
| 55 | common = parts[0] |
| 56 | for p in parts[1:]: |
| 57 | i = 0 |
| 58 | while i < len(common) and i < len(p) and common[i] == p[i]: |
| 59 | i += 1 |
| 60 | common = common[:i] |
| 61 | return str(Path(*common)) if common else "" |
| 62 | |
| 63 | |
| 64 | def _make_truncation_leaf( |