mirror of
https://github.com/openclaw/openclaw.git
synced 2026-06-06 08:42:54 +00:00
11 lines
431 B
TypeScript
11 lines
431 B
TypeScript
import { timestampMsToIsoString } from "openclaw/plugin-sdk/number-runtime";
|
|
|
|
export function resolveMemoryCoreNowMs(nowMs: unknown): number {
|
|
return timestampMsToIsoString(nowMs) === undefined ? Date.now() : (nowMs as number);
|
|
}
|
|
|
|
export function resolveMemoryCoreTimestamp(nowMs: unknown): string {
|
|
const timestampMs = resolveMemoryCoreNowMs(nowMs);
|
|
return timestampMsToIsoString(timestampMs) ?? new Date().toISOString();
|
|
}
|