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

Function statFactory

packages/platform/node-shared/src/NodeFileSystem.ts:634–641  ·  view source on GitHub ↗
(method: string, nodeStatFn: typeof NFS.stat)

Source from the content-addressed store, hash-verified

632 catch: handleBadArgument(method)
633 })
634const statFactory = (method: string, nodeStatFn: typeof NFS.stat) => {
635 const nodeStat = effectify(
636 nodeStatFn,
637 handleErrnoException("FileSystem", method),
638 handleBadArgument(method)
639 )
640 return (path: string) => Effect.flatMap(nodeStat(path, { bigint: true }), (stat) => makeFileInfo(stat, method))
641}
642const stat = statFactory("stat", NFS.stat)
643const lstat = statFactory("lstat", NFS.lstat)
644

Callers 1

NodeFileSystem.tsFile · 0.85

Calls 3

handleErrnoExceptionFunction · 0.90
handleBadArgumentFunction · 0.85
makeFileInfoFunction · 0.70

Tested by

no test coverage detected