Skip to main content

normalize_path

Function normalize_path 

Source
pub fn normalize_path(input: &str, options: PathInputOptions<'_>) -> PathBuf
Expand description

Normalize a path string according to PathInputOptions.

Order matches TypeScript normalizePath:

  1. optional trim
  2. optional Unicode-space normalization
  3. optional leading-@ strip
  4. optional tilde expansion (~, ~/, Windows ~\ only — not ~user)
  5. file:// conversion via WHATWG Url::to_file_path

Relative paths stay relative. This does not join against a base directory; use resolve_path / resolve_path_with for that.