t2-mapper/src/stringUtils.ts

9 lines
332 B
TypeScript
Raw Normal View History

2025-11-12 19:22:29 -08:00
/**
* 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) {
2025-09-11 16:48:23 -07:00
return pathString.replace(/\\/g, "/").replace(/\/+/g, "/");
}