mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-03 02:40:21 +00:00
refactor: dedupe non-empty string helper
This commit is contained in:
@@ -6,7 +6,7 @@ export const CHANNEL_TARGET_DESCRIPTION =
|
||||
export const CHANNEL_TARGETS_DESCRIPTION =
|
||||
"Recipient/channel targets (same format as --target); accepts ids or names when the directory is available.";
|
||||
|
||||
function hasNonEmptyString(value: unknown): value is string {
|
||||
export function hasNonEmptyString(value: unknown): value is string {
|
||||
return typeof value === "string" && value.trim().length > 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -16,6 +16,7 @@ import {
|
||||
} from "../infra/exec-safe-bin-runtime-policy.js";
|
||||
import { listRiskyConfiguredSafeBins } from "../infra/exec-safe-bin-semantics.js";
|
||||
import { normalizeTrustedSafeBinDirs } from "../infra/exec-safe-bin-trust.js";
|
||||
import { hasNonEmptyString } from "../infra/outbound/channel-target.js";
|
||||
import { getActivePluginRegistry } from "../plugins/runtime.js";
|
||||
import { DEFAULT_AGENT_ID } from "../routing/session-key.js";
|
||||
import { asNullableRecord } from "../shared/record-coerce.js";
|
||||
@@ -197,10 +198,6 @@ function normalizeAllowFromList(list: Array<string | number> | undefined | null)
|
||||
return list.map((v) => String(v).trim()).filter(Boolean);
|
||||
}
|
||||
|
||||
function hasNonEmptyString(value: unknown): boolean {
|
||||
return typeof value === "string" && value.trim().length > 0;
|
||||
}
|
||||
|
||||
export async function collectFilesystemFindings(params: {
|
||||
stateDir: string;
|
||||
configPath: string;
|
||||
|
||||
Reference in New Issue
Block a user