parent method
Returns the Path without its final component, if there is one. This means it returns Some("")/"" for relative paths with one component. Returns None/null if the path terminates in a root or prefix, or if it’s the empty string.
Implementation
Path? parent() => Env.isWindows
? WindowsPath(_string).parent()?._string.asPath()
: UnixPath(_string).parent()?._string.asPath();