This commit is contained in:
Brian Beck 2025-11-12 19:22:29 -08:00
parent 7de0355f3a
commit ee6ff28af5
11 changed files with 157 additions and 95 deletions

View file

@ -1,3 +1,8 @@
export function normalize(pathString: string) {
/**
* Normalizes a path string, but not as complicated as Node's `path.normalize`.
* This simply changes all backslashes to `/` (regardless of platform) and
* collapses any adjacent slashes to a single slash.
*/
export function normalizePath(pathString: string) {
return pathString.replace(/\\/g, "/").replace(/\/+/g, "/");
}