MCPcopy Create free account
hub / github.com/Effect-TS/effect / stat

Function stat

packages/platform/node-shared/test/NodeFileSystem.test.ts:233–247  ·  view source on GitHub ↗
(
    _pathOrFd: string | number,
    optionsOrCallback: { bigint?: boolean } | ((error: null, stats: object) => void),
    callback?: (error: null, stats: object) => void
  )

Source from the content-addressed store, hash-verified

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),

Callers 2

watchNodeFunction · 0.50
watchFunction · 0.50

Calls 3

doneFunction · 0.50
NumberFunction · 0.50
mapMethod · 0.45

Tested by

no test coverage detected