Skip to main content

Module lexical_path

Module lexical_path 

Source
Expand description

Lexical path normalization. What: Lexical path normalization, the way Node’s path.resolve does it. Why: git cli-git doctor scans each hooks directory once, so one directory named two ways (./hooks, hooks/, a/../hooks) must compare equal without touching the file system.

In TS you’d write (pseudocode):

path.resolve(path);

Functions§

normalized_path
What: Normalize a path lexically: drop ., fold .. into the component before it, never above the root. Why: PathBuf::join keeps . and .., and a .. above the root stays at the root, as Node clamps it.