fastify-static
fastify-static copied to clipboard
feat: use node's built-in globbing tool
We CANNOT move to node's built-in globbing mechanism, this PR is to show this, and can potentially be used later to build upon.
The node:fs.glob function does not traverse symbolic links that point to directories. It does not expose an option to enable traversal of directory symlinks, unlike the behavior found in the existing globbing libraries.
I have raised a feature request with the node team for this: https://github.com/nodejs/node/issues/61033 Relevant node globbing file: https://github.com/nodejs/node/blob/main/lib/internal/fs/glob.js
Failing tests:
✖ should follow symbolic link without wildcard (12.977115ms)
✖ should serve files into hidden dir with wildcard `false` (7.238363ms)
Checklist
- [x] run
npm run test && npm run benchmark --if-present - [x] tests and/or benchmarks are included
- [ ] documentation is changed or added
- [ ] commit message and code follows the Developer's Certification of Origin and the Code of conduct