refactor: dedupe non-empty string helper

This commit is contained in:
Peter Steinberger
2026-04-06 23:39:38 +01:00
parent d94938ff54
commit e336311126
2 changed files with 2 additions and 5 deletions

View File

@@ -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;
}

View File

@@ -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;