refactor: dedupe feishu security string helper

This commit is contained in:
Peter Steinberger
2026-04-06 22:55:57 +01:00
parent e420468ebd
commit 2f4b322911
2 changed files with 5 additions and 5 deletions

View File

@@ -25,6 +25,10 @@ export function asRecord(value: unknown): Record<string, unknown> | undefined {
return value as Record<string, unknown>;
}
export function hasNonEmptyString(value: unknown): value is string {
return typeof value === "string" && value.trim().length > 0;
}
export function extractCommentElementText(element: unknown): string | undefined {
if (!isRecord(element)) {
return undefined;

View File

@@ -1,10 +1,6 @@
import type { OpenClawConfig } from "openclaw/plugin-sdk/config-runtime";
import { hasConfiguredSecretInput } from "openclaw/plugin-sdk/setup";
import { asRecord } from "./comment-shared.js";
function hasNonEmptyString(value: unknown): boolean {
return typeof value === "string" && value.trim().length > 0;
}
import { asRecord, hasNonEmptyString } from "./comment-shared.js";
function isFeishuDocToolEnabled(cfg: OpenClawConfig): boolean {
const channels = asRecord(cfg.channels);