MCPcopy Create free account
hub / github.com/isomorphic-git/isomorphic-git / normalizeStats

Function normalizeStats

src/utils/normalizeStats.js:22–50  ·  view source on GitHub ↗
(e)

Source from the content-addressed store, hash-verified

20}
21
22export function normalizeStats(e) {
23 const [ctimeSeconds, ctimeNanoseconds] = SecondsNanoseconds(
24 e.ctimeSeconds,
25 e.ctimeNanoseconds,
26 e.ctimeMs,
27 e.ctime
28 )
29 const [mtimeSeconds, mtimeNanoseconds] = SecondsNanoseconds(
30 e.mtimeSeconds,
31 e.mtimeNanoseconds,
32 e.mtimeMs,
33 e.mtime
34 )
35
36 return {
37 ctimeSeconds: ctimeSeconds % MAX_UINT32,
38 ctimeNanoseconds: ctimeNanoseconds % MAX_UINT32,
39 mtimeSeconds: mtimeSeconds % MAX_UINT32,
40 mtimeNanoseconds: mtimeNanoseconds % MAX_UINT32,
41 dev: e.dev % MAX_UINT32,
42 ino: e.ino % MAX_UINT32,
43 mode: normalizeMode(e.mode % MAX_UINT32),
44 uid: e.uid % MAX_UINT32,
45 gid: e.gid % MAX_UINT32,
46 // size of -1 happens over a BrowserFS HTTP Backend that doesn't serve Content-Length headers
47 // (like the Karma webserver) because BrowserFS HTTP Backend uses HTTP HEAD requests to do fs.stat
48 size: e.size > -1 ? e.size % MAX_UINT32 : 0,
49 }
50}

Callers 5

compareStatsFunction · 0.90
insertMethod · 0.90
_entryToBufferMethod · 0.90
statMethod · 0.90
statMethod · 0.90

Calls 2

normalizeModeFunction · 0.90
SecondsNanosecondsFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…