Fnormalize
Bun

function

path.default.normalize

function normalize(
path: string
): string;

Normalize a string path, reducing '..' and '.' parts. When multiple slashes are found, they're replaced by a single one; when the path contains a trailing slash, it is preserved. On Windows backslashes are used. If the path is a zero-length string, '.' is returned, representing the current working directory.

@param path

string path to normalize.