Skip to content

PurePath.suffix property

pathlib-ts > PurePath > suffix

Returns the rightmost suffix (including the leading dot) for the last path segment.

Signature:

get suffix(): string;

Matches CPython semantics, including treating a standalone dot as a valid suffix in 3.14+. Use this when you need to dispatch on file extensions without mutating the path.