fluidcad 0.0.11 → 0.0.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Normalize a file path to use forward slashes.
|
|
2
|
+
* Normalize a file path to use forward slashes and uppercase drive letter.
|
|
3
3
|
* No-op on Unix. On Windows, converts backslashes to forward slashes
|
|
4
|
-
* to match Vite's internal module graph keying.
|
|
4
|
+
* and uppercases the drive letter to match Vite's internal module graph keying.
|
|
5
5
|
*/
|
|
6
6
|
export declare function normalizePath(p: string): string;
|
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Normalize a file path to use forward slashes.
|
|
2
|
+
* Normalize a file path to use forward slashes and uppercase drive letter.
|
|
3
3
|
* No-op on Unix. On Windows, converts backslashes to forward slashes
|
|
4
|
-
* to match Vite's internal module graph keying.
|
|
4
|
+
* and uppercases the drive letter to match Vite's internal module graph keying.
|
|
5
5
|
*/
|
|
6
6
|
export function normalizePath(p) {
|
|
7
|
-
|
|
7
|
+
const slashed = p.replace(/\\/g, '/');
|
|
8
|
+
if (slashed.length >= 2 && slashed[1] === ':') {
|
|
9
|
+
return slashed[0].toUpperCase() + slashed.slice(1);
|
|
10
|
+
}
|
|
11
|
+
return slashed;
|
|
8
12
|
}
|