Skip to content

Commit c7db95a

Browse files
authored
perf: use replaceAll for slash normalisation (#13738)
1 parent f8c9a71 commit c7db95a

File tree

4 files changed

+9
-2
lines changed

4 files changed

+9
-2
lines changed

.changeset/tasty-peas-retire.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
"@react-router/remix-routes-option-adapter": patch
3+
"@react-router/fs-routes": patch
4+
---
5+
6+
Use `replaceAll` for normalising windows file system slashes.

contributors.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
- 0xEddie
22
- 3fuyang
3+
- 43081j
34
- aarbi
45
- abdallah-nour
56
- abeadam
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import path from "node:path";
22

33
export function normalizeSlashes(file: string) {
4-
return file.split(path.win32.sep).join("/");
4+
return file.replaceAll(path.win32.sep, "/");
55
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import path from "node:path";
22

33
export function normalizeSlashes(file: string) {
4-
return file.split(path.win32.sep).join("/");
4+
return file.replaceAll(path.win32.sep, "/");
55
}

0 commit comments

Comments
 (0)