This repository was archived by the owner on Jun 2, 2022. It is now read-only.
Commit 5c6e90c
committed
fix: de/normalise all file separators in a string
currently our tests fail on Windows because we neglect to normalise/denormalise all path separators.
when interacting with the local filesystem, we need to make sure to use the native separator (slash on linux, backslash on windows).
our normalising function used `string.prototype.replace(str, str)` which replaces only the first occurrence in a string.
this commit fixes it to the `string.prototype.replace(regex, str)` signature which, coupled with a global regex, replaces all occurences.
this commit isn't accompanied with a test since an existing test is already broken, and that test passing will be the proof of correctness.1 parent 8129211 commit 5c6e90c
1 file changed
+2
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
42 | | - | |
| 42 | + | |
43 | 43 | | |
44 | 44 | | |
45 | 45 | | |
46 | 46 | | |
47 | 47 | | |
48 | 48 | | |
49 | | - | |
| 49 | + | |
50 | 50 | | |
51 | 51 | | |
52 | 52 | | |
| |||
0 commit comments