MCPcopy Create free account
hub / github.com/callstack/agent-device / formatSnapshotAge

Function formatSnapshotAge

src/utils/output.ts:146–153  ·  view source on GitHub ↗
(ageMs: number)

Source from the content-addressed store, hash-verified

144}
145
146function formatSnapshotAge(ageMs: number): string {
147 if (ageMs < 1000) return `${Math.round(ageMs)}ms`;
148 if (ageMs < 60_000) return `${(Math.round(ageMs / 100) / 10).toFixed(1)}s`;
149 const minutes = ageMs / 60_000;
150 if (minutes < 60) return `${(Math.round(minutes * 10) / 10).toFixed(1)}m`;
151 const hours = minutes / 60;
152 return `${(Math.round(hours * 10) / 10).toFixed(1)}h`;
153}
154
155function formatSnapshotMetaPrefix(data: Record<string, unknown>): string {
156 const appName = typeof data.appName === 'string' ? data.appName : undefined;

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…