MCPcopy
hub / github.com/ValueCell-ai/ClawX / normalizeTimestampMs

Function normalizeTimestampMs

electron/services/cron-api.ts:78–87  ·  view source on GitHub ↗
(value: unknown)

Source from the content-addressed store, hash-verified

76}
77
78function normalizeTimestampMs(value: unknown): number | undefined {
79 if (typeof value === 'number' && Number.isFinite(value)) {
80 return value < 1e12 ? value * 1000 : value;
81 }
82 if (typeof value === 'string' && value.trim()) {
83 const parsed = Date.parse(value);
84 if (Number.isFinite(parsed)) return parsed;
85 }
86 return undefined;
87}
88
89function formatDuration(durationMs: number | undefined): string | null {
90 if (!durationMs || !Number.isFinite(durationMs)) return null;

Callers 3

buildCronRunMessageFunction · 0.85
createCronApiFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected