| 231 | const original = await importOriginal<typeof NFS>() |
| 232 | // Match Node's number and bigint stat modes. |
| 233 | const stat = ( |
| 234 | _pathOrFd: string | number, |
| 235 | optionsOrCallback: { bigint?: boolean } | ((error: null, stats: object) => void), |
| 236 | callback?: (error: null, stats: object) => void |
| 237 | ) => { |
| 238 | const bigint = typeof optionsOrCallback === "object" && optionsOrCallback.bigint |
| 239 | const done = typeof optionsOrCallback === "function" ? optionsOrCallback : callback! |
| 240 | done(null, { |
| 241 | ...Object.fromEntries(Object.entries(state.values).map(([key, value]) => [key, bigint ? value : Number(value)])), |
| 242 | mtime: new Date(0), |
| 243 | atime: new Date(0), |
| 244 | birthtime: new Date(0), |
| 245 | isFile: () => true |
| 246 | }) |
| 247 | } |
| 248 | const doubles = { |
| 249 | open: (_path: string, _flags: string, _mode: unknown, callback: (error: null, fd: number) => void) => |
| 250 | callback(null, 42), |