Skip to content

Commit 8973242

Browse files
committed
Avoid overhead
1 parent 5597a9a commit 8973242

1 file changed

Lines changed: 7 additions & 9 deletions

File tree

‎src/compiler/path.ts‎

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -515,15 +515,13 @@ export function getPathFromPathComponents(pathComponents: readonly string[]) {
515515
*
516516
* @internal
517517
*/
518-
export function normalizeSlashes(path: string): string {
519-
if (typeof process === undefined || process.platform !== "win32") {
520-
return path;
521-
}
522-
523-
return path.indexOf("\\") !== -1
524-
? path.replace(backslashRegExp, directorySeparator)
525-
: path;
526-
}
518+
export const normalizeSlashes: (path: string) => string = typeof process === undefined || process.platform !== "win32"
519+
? path => path
520+
: path => {
521+
return path.indexOf("\\") !== -1
522+
? path.replace(backslashRegExp, directorySeparator)
523+
: path;
524+
};
527525

528526
/**
529527
* Reduce an array of path components to a more simplified path by navigating any

0 commit comments

Comments
 (0)