chokidar
chokidar copied to clipboard
Chokidar does not detect files containing the word "undefined"
Describe the bug
Choidar does not detect files when the word "undefined" is contained within the file name.
Versions (please complete the following information):
- Chokidar version: v3.5.3
- Node version: v16.13.0
- OS version: Ubuntu 18, Windows 10
To Reproduce:
- Create a folder named "upload" on the root directory.
- Create two files - one named "test.json" another named "undefined.json"
- Run the program below
- Copy both "test.json" and "undefined.json" to the upload directory
- Observe that only "test.json" is detected
const chokidar = require('chokidar');
const watcher = chokidar.watch('upload/*.json', {
ignored: /(^|[\/\\])\../, // ignore dotfiles
persistent: true
});
watcher.on('ready', () => console.log('Watching dir...'))
watcher.on('add', path => console.log(`File ${path} has been added`))
PS C:\Apps\Projects\Sandbox> node chokidar.js
Watching dir...
File upload\test.json has been added
Expected behavior The undefined.json file should be detected and notified via the 'add' event