mirror of
https://github.com/Drop-OSS/drop.git
synced 2026-01-31 15:37:09 +01:00
12 lines
301 B
TypeScript
12 lines
301 B
TypeScript
import type { TaskLog } from "~/server/internal/tasks";
|
|
|
|
export function parseTaskLog(logStr: string | undefined): typeof TaskLog.infer {
|
|
if (!logStr) return { message: "", timestamp: "" };
|
|
const log = JSON.parse(logStr);
|
|
|
|
return {
|
|
message: log.message,
|
|
timestamp: log.timestamp,
|
|
};
|
|
}
|