Version
24.3.0
Platform
Subsystem
No response
What steps will reproduce the bug?
on windows
files structure
let r = await glob("a/node_moduleS", {
cwd: "root",
})
let files = await Array.fromAsync(r)
console.log(files);
output
This is the first issue, the result preserves the original glob casing instead of the casing on the filesystem
expected
-['a'\\node_moduleS`]
+['a'\\node_modules`]
when we try to exclude with the actual casing on the filesystem
the exclude actually uses case aware, and in this case it fails to exclude the actual path
on the file system
let r = await glob("a/node_moduleS", {
cwd: "root",
exclude: ["a/node_modules"]
})
let files = await Array.fromAsync(r)
console.log(files);
output
instead of the expected
- [ 'a\\node_moduleS' ]
+ []
How often does it reproduce? Is there a required condition?
always
What is the expected behavior? Why is that the expected behavior?
- globing should always return the actual casing from the filesystem
- if the glob pattern is case insensitive so should the exclude patterns.
- we should be able to configure the casing of the matcher because on windows we may have case sensitive file system too. see final note for the proposal of enhancement
What do you see instead?
- on windows the glob results are returned with the casing of the pattern instead of preserving the filesystem casing
- the exclude patterns are case sensitive
Additional information
Additionally I think the glob case sensitive should be configurable
either be explicitly
await glob("a/node_moduleS", {
cwd: "root",
casing: "default", // default - window case-insensitive , linux - case sensitive
// yes - case sensitive regardless of operation system
// no - case insensitive regardless of operation system
})
windows also supports case sensitive file system as you can see here
https://learn.microsoft.com/en-us/windows/wsl/case-sensitivity

Version
24.3.0
Platform
Subsystem
No response
What steps will reproduce the bug?
on windows
files structure
output
This is the first issue, the result preserves the original glob casing instead of the casing on the filesystem
expected
when we try to exclude with the actual casing on the filesystem
the exclude actually uses case aware, and in this case it fails to exclude the actual path
on the file system
output
instead of the expected
How often does it reproduce? Is there a required condition?
always
What is the expected behavior? Why is that the expected behavior?
What do you see instead?
Additional information
Additionally I think the glob case sensitive should be configurable
either be explicitly
windows also supports case sensitive file system as you can see here
https://learn.microsoft.com/en-us/windows/wsl/case-sensitivity