vercel / pkg

Package your Node.js project into an executable
https://npmjs.com/pkg
MIT License
24.33k stars 1.02k forks source link

fix: Add missing functions from restored fs.Stats #1923

Closed phated closed 1 year ago

phated commented 1 year ago

In my project, I noticed that a library that used isCharacterDevice on a file from the snapshot crashed. This adds the missing functions as noops (and I made isFIFO use noop so it was clearer).

I thought about making these mirror their files that were included, but I don't think either makes sense within the virtual fs. Please correct me if I'm wrong.

robertsLando commented 1 year ago

@phated wouldn't it make more sense to return false instead of using noop there? Otherwise simply create a function returnFalse and use that there?

phated commented 1 year ago

@robertsLando that's what noop does. It's used for Dirent prototype too