MCPcopy Index your code
hub / github.com/callstack/agent-device / newestMtimeMs

Function newestMtimeMs

scripts/clean-daemon.ts:99–111  ·  view source on GitHub ↗
(dirPath: string)

Source from the content-addressed store, hash-verified

97}
98
99function newestMtimeMs(dirPath: string): number {
100 let newest = statMtimeMs(dirPath);
101 let children: fs.Dirent[];
102 try {
103 children = fs.readdirSync(dirPath, { withFileTypes: true });
104 } catch {
105 return newest;
106 }
107 for (const child of children) {
108 newest = Math.max(newest, statMtimeMs(path.join(dirPath, child.name)));
109 }
110 return newest;
111}
112
113function statMtimeMs(filePath: string): number {
114 try {

Callers 1

pruneStaleDevStateDirsFunction · 0.85

Calls 1

statMtimeMsFunction · 0.85

Tested by

no test coverage detected