mirror of
https://github.com/openclaw/openclaw.git
synced 2026-07-17 08:11:43 +00:00
refactor(plugins): consolidate record guards (#99361)
This commit is contained in:
@@ -15,6 +15,7 @@ import {
|
||||
updateSessionStore,
|
||||
} from "openclaw/plugin-sdk/session-store-runtime";
|
||||
import { resolveStateDir } from "openclaw/plugin-sdk/state-paths";
|
||||
import { isRecord } from "openclaw/plugin-sdk/string-coerce-runtime";
|
||||
|
||||
const FEISHU_STATE_DIR = "feishu";
|
||||
const BACKUP_PREFIX = "feishu-state-repair";
|
||||
@@ -84,10 +85,6 @@ function timestampForPath(now = new Date()): string {
|
||||
return now.toISOString().replaceAll(":", "-");
|
||||
}
|
||||
|
||||
function isRecord(value: unknown): value is Record<string, unknown> {
|
||||
return Boolean(value && typeof value === "object" && !Array.isArray(value));
|
||||
}
|
||||
|
||||
function toFeishuSessionEntry(value: unknown): FeishuSessionEntry {
|
||||
if (!isRecord(value)) {
|
||||
return {};
|
||||
|
||||
Reference in New Issue
Block a user