t2-mapper/src/stringUtils.ts
Brian Beck ee6ff28af5 wip
2025-11-12 19:23:30 -08:00

8 lines
332 B
TypeScript

/**
* 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, "/");
}