Files
openclaw/src/infra/system-run-normalize.ts
2026-03-07 23:27:51 +00:00

14 lines
411 B
TypeScript

import { mapAllowFromEntries } from "../plugin-sdk/channel-config-helpers.js";
export function normalizeNonEmptyString(value: unknown): string | null {
if (typeof value !== "string") {
return null;
}
const trimmed = value.trim();
return trimmed ? trimmed : null;
}
export function normalizeStringArray(value: unknown): string[] {
return Array.isArray(value) ? mapAllowFromEntries(value) : [];
}