Files
claude-plugins-official/plugins/claude-security/scripts/lib/absolute.py
2026-08-17 14:57:41 -05:00

16 lines
415 B
Python

"""Whether a path is spelled absolutely on any platform, not just the one this runs on."""
from __future__ import annotations
import ntpath
import os
def spelled(path: str) -> bool:
"""True for a rooted, drive-qualified or UNC path, whichever platform reads it."""
return (
os.path.isabs(path)
or path.replace("\\", "/").startswith("/")
or bool(ntpath.splitdrive(path)[0])
)