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

Function fromFileInfo

packages/effect/src/unstable/http/Etag.ts:82–88  ·  view source on GitHub ↗
(info: FileSystem.File.Info)

Source from the content-addressed store, hash-verified

80}>()("effect/http/Etag/Generator") {}
81
82const fromFileInfo = (info: FileSystem.File.Info) => {
83 const mtime = Option.match(info.mtime, {
84 onNone: () => "0",
85 onSome: (mtime) => mtime.getTime().toString(16)
86 })
87 return `${info.size.toString(16)}-${mtime}`
88}
89
90const fromFileWeb = (file: Body.HttpBody.FileLike) => {
91 return `${file.size.toString(16)}-${file.lastModified.toString(16)}`

Callers

nothing calls this directly

Calls 2

toStringMethod · 0.65
syncMethod · 0.45

Tested by

no test coverage detected