Expand description
Utilities for lexical manipulation of unix-style (/
-separated) paths represented as unicode
strings.
These paths types are frequently used for JS imports, and are used within Turbopack to represent platform-agnostic relative paths.
This crate does not perform any IO, and does not depend on turbo-tasks. Most users should prefer the
turbo-tasks-fs
crate.
Functions§
- get_
parent_ path - get_
relative_ path_ to - join_
path - Joins two /-separated paths into a normalized path. Paths are concatenated with /.
- normalize_
path - Normalizes a /-separated path into a form that contains no leading /, no double /, no “.” segment, no “..” segment.
- normalize_
request - Normalizes a /-separated request into a form that contains no leading /, no double /, and no “.” or “..” segments in the middle of the request.
- sys_
to_ unix - Converts system paths into Unix paths. This is a noop on Unix systems, and replaces backslash directory separators with forward slashes on Windows.
- unix_
to_ sys - Converts Unix paths into system paths. This is a noop on Unix systems, and replaces forward slash directory separators with backslashes on Windows.