mirror of
https://github.com/openclaw/openclaw.git
synced 2026-03-12 07:20:45 +00:00
14 lines
411 B
TypeScript
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) : [];
|
|
}
|