PurePath.isRelativeTo() method
pathlib-ts > PurePath > isRelativeTo
PurePath.isRelativeTo() method
Section titled “PurePath.isRelativeTo() method”Returns true when the path can be expressed relative to another path without leaving its subtree.
Signature:
isRelativeTo(other: PathLike): boolean;Parameters
Section titled “Parameters”|
Parameter |
Type |
Description |
|---|---|---|
|
other |
Anchor used to determine lexical containment. |
Returns:
boolean
true when other is a lexical ancestor or the same path.
Remarks
Section titled “Remarks”This is a lexical check that does not hit the filesystem. It aligns with CPython’s is_relative_to and powers Path.isRelativeTo before the async policy layer.