3 Commits
Author SHA1 Message Date
dualfroz 6edd4e97e3 Describe this repository 2026-10-22 21:05:24 +02:00
dualfroz 79f1b99f82 fix: use basename for name field of static-pattern entries in object mode
With objectMode enabled, static patterns exposed the full pattern string
as entry.name and dirent.name instead of the basename, unlike dynamic
patterns which already returned the basename via @nodelib/fs.walk. Reader#_makeEntry
now derives the basename once and uses it consistently for both fields,
leaving entry.path unchanged.
2026-09-04 03:09:33 +02:00
dualfroz e246fef883 fix: use the basename as the entry name for static patterns
The static reader built the entry from the pattern as is, so `name` and
`dirent.name` were the whole pattern, while the dynamic reader returns
the basename. The same `objectMode: true` option therefore produced a
different entry shape depending on whether the pattern was static:

  globSync('fixtures/file.md', { objectMode: true })
  // name: 'fixtures/file.md', path: 'fixtures/file.md'

  globSync('fixtures/*.md', { objectMode: true })
  // name: 'file.md', path: 'fixtures/file.md'

Note that `path` already agreed between the two readers, only `name`
diverged. Use the basename for the entry name and for the dirent built
from the stats, which matches both the dynamic reader and the entry
builder the tests already use.

Fixes #487
2026-09-03 14:37:27 +02:00