Commit 10eb00b
committed
fix(path): add Windows validation for Unix-style paths in findNpmDirPathSync
On Windows, Unix-style paths starting with / are not valid and will fail
path operations. Add early return to prevent attempting to resolve these
invalid paths.
This defensive check aligns with the test expectations where Unix paths
return undefined on Windows platforms.
Also updated path examples in comments to use environment variables instead
of hardcoded usernames.1 parent 96df945 commit 10eb00b
1 file changed
+6
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
50 | 50 | | |
51 | 51 | | |
52 | 52 | | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
53 | 57 | | |
54 | 58 | | |
55 | 59 | | |
| |||
79 | 83 | | |
80 | 84 | | |
81 | 85 | | |
82 | | - | |
83 | | - | |
| 86 | + | |
| 87 | + | |
84 | 88 | | |
85 | 89 | | |
86 | 90 | | |
| |||
0 commit comments