Commit b684074
committed
mimic node's intended behavior with weird paths
When removing any path that has `..` or `.` as path portions, call
`path.normalize` on the path before attempting to process it.
When removing the path `''`, throw a `stat ENOENT` error.
When removing `.`, replace with `process.cwd()` and proceed as normal.
Also, add support for deleting `file:` URLs and Buffer paths, which are
normalized to strings for the benefit of older Node versions.
Glob patters must still be normal `strings`.
This mirrors the behavior of node, once nodejs/node#61968 lands.
Closes: #342
Fixes: #326
Re: nodejs/node#61958
Credit: @abhu85, @RajeshKumar11, @isaacs1 parent 7263194 commit b684074
13 files changed
Lines changed: 598 additions & 467 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
52 | 52 | | |
53 | 53 | | |
54 | 54 | | |
55 | | - | |
56 | | - | |
57 | | - | |
58 | | - | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
1 | 8 | | |
2 | 9 | | |
3 | 10 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
82 | 82 | | |
83 | 83 | | |
84 | 84 | | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
85 | 90 | | |
86 | 91 | | |
87 | 92 | | |
| |||
0 commit comments