refactor: dedupe elevenlabs talk record helper

This commit is contained in:
Peter Steinberger
2026-04-06 23:08:08 +01:00
parent 08c0018536
commit e9befcff9e
2 changed files with 6 additions and 6 deletions

View File

@@ -22,7 +22,7 @@ type ElevenLabsApiKeyDeps = {
export const ELEVENLABS_TALK_PROVIDER_ID = "elevenlabs";
function isRecord(value: unknown): value is JsonRecord {
export function isRecord(value: unknown): value is JsonRecord {
return typeof value === "object" && value !== null && !Array.isArray(value);
}

View File

@@ -1,10 +1,10 @@
import type { ChannelDoctorLegacyConfigRule } from "openclaw/plugin-sdk/channel-contract";
import type { OpenClawConfig } from "openclaw/plugin-sdk/config-runtime";
import { ELEVENLABS_TALK_PROVIDER_ID, migrateElevenLabsLegacyTalkConfig } from "./config-compat.js";
function isRecord(value: unknown): value is Record<string, unknown> {
return Boolean(value) && typeof value === "object" && !Array.isArray(value);
}
import {
ELEVENLABS_TALK_PROVIDER_ID,
isRecord,
migrateElevenLabsLegacyTalkConfig,
} from "./config-compat.js";
export function hasLegacyTalkFields(value: unknown): boolean {
const talk = isRecord(value) ? value : null;