We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
0.1.4
Linux davidpc 5.15.0-41-generic #44-Ubuntu SMP Wed Jun 22 14:20:53 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
I initially found this issue running code which uses Chokidar, but have also replicated it with code that simply uses fs.stat
fs.stat
import { stat } from 'fs'; import { stat as stat_p } from 'fs/promises'; import { inspect } from 'util'; const fn = process.argv[2]; stat(fn, (err, stats) => { if (err) console.error(err); else { console.log(inspect(stats)); console.log(inspect(stats.isSymbolicLink)); } }); try { const stats = await stat_p(fn); console.log(inspect(stats)); console.log(inspect(stats.isSymbolicLink)); } catch (err) { console.error(err); }
Gives the output:
$ bun stat.mjs stat.mjs { [Function] dev: 2053, ino: 18356089, mode: 33204, nlink: 1, uid: 1000, gid: 1000, rdev: 0, size: 472, blksize: 4096, blocks: 8, atime: Tue Jul 19 2022 23:08:10 GMT-0700 (Pacific Daylight Time), mtime: Tue Jul 19 2022 23:08:10 GMT-0700 (Pacific Daylight Time), ctime: Tue Jul 19 2022 23:08:10 GMT-0700 (Pacific Daylight Time), birthtime: Wed Dec 31 1969 16:00:00 GMT-0800 (Pacific Standard Time), atime_ms: 719, mtime_ms: 711, ctime_ms: 711, birthtime_ms: 0, isFile: [Function: isFile], isDirectory: [Function: isDirectory], finalize: undefined } undefined { [Function] dev: 2053, ino: 18356089, mode: 33204, nlink: 1, uid: 1000, gid: 1000, rdev: 0, size: 472, blksize: 4096, blocks: 8, atime: Tue Jul 19 2022 23:08:10 GMT-0700 (Pacific Daylight Time), mtime: Tue Jul 19 2022 23:08:10 GMT-0700 (Pacific Daylight Time), ctime: Tue Jul 19 2022 23:08:10 GMT-0700 (Pacific Daylight Time), birthtime: Wed Dec 31 1969 16:00:00 GMT-0800 (Pacific Standard Time), atime_ms: 719, mtime_ms: 711, ctime_ms: 711, birthtime_ms: 0, isFile: [Function: isFile], isDirectory: [Function: isDirectory], finalize: undefined } undefined
The Chokidar example is this:
const { inspect } = require('util'); const chokidar = require('chokidar'); chokidar.watch(process.argv[2]) .on('error', async (error) => { console.error(error); }) .on('add', (fpath, stats) => { console.log(`add ${fpath} ${inspect(stats)}`); }) .on('change', (fpath, stats) => { console.log(`change ${fpath} ${inspect(stats)}`); });
The output is:
242 | } 243 | 244 | filterPath(entry) { 245 | const {stats} = entry; 246 | console.log(`filterPath ${inspect(stats)}`); 247 | if (stats && stats.isSymbolicLink()) return this.filterDir(entry); ^ TypeError: stats.isSymbolicLink is not a function. (In 'stats.isSymbolicLink()', 'stats.isSymbolicLink' is undefined) at filterPath (/home/david/Projects/akasharender/stacked-directories/node_modules/chokidar/index.js:247:17) at /home/david/Projects/akasharender/stacked-directories/node_modules/readdirp/index.js:141:79
The console.log also shows that the stats object does not have the isSymbolicLink function.
console.log
isSymbolicLink
Every time
In the Node.js documentation, isSymbolicLink has been included in the Stats object since v10.10.0
It's clear that this function should be included in the object.
As noted above, the Stats object does not have the isSymbolicLink function
No response
The text was updated successfully, but these errors were encountered:
I'd like to work on this
Sorry, something went wrong.
Successfully merging a pull request may close this issue.
Version
0.1.4
Platform
Linux davidpc 5.15.0-41-generic #44-Ubuntu SMP Wed Jun 22 14:20:53 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
What steps will reproduce the bug?
I initially found this issue running code which uses Chokidar, but have also replicated it with code that simply uses
fs.stat
Gives the output:
The Chokidar example is this:
The output is:
The
console.log
also shows that the stats object does not have theisSymbolicLink
function.How often does it reproduce? Is there a required condition?
Every time
What is the expected behavior?
In the Node.js documentation,
isSymbolicLink
has been included in the Stats object since v10.10.0It's clear that this function should be included in the object.
What do you see instead?
As noted above, the Stats object does not have the
isSymbolicLink
functionAdditional information
No response
The text was updated successfully, but these errors were encountered: