Skip to content

ResolutionPolicy type

pathlib-ts > ResolutionPolicy

Policy for resolving how the other argument should be treated.

Signature:

export type ResolutionPolicy = "auto" | "parent" | "exact";

Applied by Path.relativeTo and Path.isRelativeTo when computing relationships between concrete paths. Policies extend CPython’s lexical semantics with an optional asynchronous probe for JS module resolution scenarios.

  • "exact" (default): perform a purely lexical comparison, matching CPython’s behaviour. - "parent": anchor relative operations to other.parent without touching the filesystem. - "auto": probe the filesystem to decide whether other should be treated as a directory. This may require I/O and therefore produces a Promise.