isWithin method
Implementation
bool isWithin(String otherPath, {required bool isDir}) {
final otherPathPosix = p.posix.canonicalize(otherPath);
final isWithin = recurse
? path == otherPathPosix || p.isWithin(path, otherPathPosix)
: path == (isDir ? path == otherPathPosix : p.dirname(otherPathPosix));
return isWithin && includes(otherPathPosix, isDir: isDir);
}