mirror of
https://github.com/moltbot/moltbot.git
synced 2026-04-20 21:23:23 +00:00
refactor: dedupe matrix store record helper
This commit is contained in:
@@ -11,6 +11,7 @@ import {
|
||||
type IStoredClientOpts,
|
||||
} from "matrix-js-sdk/lib/matrix.js";
|
||||
import { writeJsonFileAtomically } from "openclaw/plugin-sdk/json-store";
|
||||
import { isRecord } from "../../record-shared.js";
|
||||
import { createAsyncLock } from "../async-lock.js";
|
||||
import { LogService } from "../sdk/logger.js";
|
||||
import { claimCurrentTokenStorageState } from "./storage.js";
|
||||
@@ -25,10 +26,6 @@ type PersistedMatrixSyncStore = {
|
||||
cleanShutdown?: boolean;
|
||||
};
|
||||
|
||||
function isRecord(value: unknown): value is Record<string, unknown> {
|
||||
return typeof value === "object" && value !== null;
|
||||
}
|
||||
|
||||
function normalizeRoomsData(value: unknown): IRooms | null {
|
||||
if (!isRecord(value)) {
|
||||
return null;
|
||||
|
||||
Reference in New Issue
Block a user