mirror of
https://github.com/openclaw/openclaw.git
synced 2026-04-18 04:31:10 +00:00
refactor: dedupe broad record guard
This commit is contained in:
@@ -1,9 +1,6 @@
|
||||
import { isRecord } from "openclaw/plugin-sdk/text-runtime";
|
||||
import type { IMessagePayload } from "./types.js";
|
||||
|
||||
function isRecord(value: unknown): value is Record<string, unknown> {
|
||||
return Boolean(value) && typeof value === "object" && !Array.isArray(value);
|
||||
}
|
||||
|
||||
function isOptionalString(value: unknown): value is string | null | undefined {
|
||||
return value === undefined || value === null || typeof value === "string";
|
||||
}
|
||||
|
||||
@@ -1,11 +1,8 @@
|
||||
import type { OpenClawConfig } from "openclaw/plugin-sdk/plugin-entry";
|
||||
import { definePluginEntry } from "openclaw/plugin-sdk/plugin-entry";
|
||||
import { isRecord } from "openclaw/plugin-sdk/text-runtime";
|
||||
import { migrateVoiceCallLegacyConfigInput } from "./config-api.js";
|
||||
|
||||
function isRecord(value: unknown): value is Record<string, unknown> {
|
||||
return Boolean(value) && typeof value === "object" && !Array.isArray(value);
|
||||
}
|
||||
|
||||
function migrateVoiceCallPluginConfig(config: OpenClawConfig): {
|
||||
config: OpenClawConfig;
|
||||
changes: string[];
|
||||
|
||||
Reference in New Issue
Block a user