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

Function makeFileInfo

packages/platform/node-shared/src/NodeFileSystem.ts:478–507  ·  view source on GitHub ↗
(stat: NFS.Stats)

Source from the content-addressed store, hash-verified

476// == stat
477
478const makeFileInfo = (stat: NFS.Stats): FileSystem.File.Info => ({
479 type: stat.isFile() ?
480 "File" :
481 stat.isDirectory() ?
482 "Directory" :
483 stat.isSymbolicLink() ?
484 "SymbolicLink" :
485 stat.isBlockDevice() ?
486 "BlockDevice" :
487 stat.isCharacterDevice() ?
488 "CharacterDevice" :
489 stat.isFIFO() ?
490 "FIFO" :
491 stat.isSocket() ?
492 "Socket" :
493 "Unknown",
494 mtime: Option.fromNullishOr(stat.mtime),
495 atime: Option.fromNullishOr(stat.atime),
496 birthtime: Option.fromNullishOr(stat.birthtime),
497 dev: stat.dev,
498 rdev: Option.fromNullishOr(stat.rdev),
499 ino: Option.fromNullishOr(stat.ino),
500 mode: stat.mode,
501 nlink: Option.fromNullishOr(stat.nlink),
502 uid: Option.fromNullishOr(stat.uid),
503 gid: Option.fromNullishOr(stat.gid),
504 size: FileSystem.Size(stat.size),
505 blksize: stat.blksize !== undefined ? Option.some(FileSystem.Size(stat.blksize)) : Option.none(),
506 blocks: Option.fromNullishOr(stat.blocks)
507})
508const stat = (() => {
509 const nodeStat = effectify(
510 NFS.stat,

Callers

nothing calls this directly

Calls 1

someMethod · 0.80

Tested by

no test coverage detected