Skip to content

Path.isRelativeTo property

pathlib-ts > Path > isRelativeTo

Determines whether this path can be expressed relative to another according to the selected policy.

Signature:

isRelativeTo: PathIsRelativeToFn;

Policies mirror Path.relativeTo. policy: "auto" triggers asynchronous I/O to validate the anchor, so the method returns a promise in that case. Use this before attempting a relative conversion to avoid handling exceptions.