Skip to main content

normalized_path

Function normalized_path 

Source
pub fn normalized_path(path: &Path) -> PathBuf
Expand description

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.

In TS you’d write (pseudocode):

path.resolve(path);