mirror of
https://github.com/openclaw/openclaw.git
synced 2026-04-13 18:21:27 +00:00
21 lines
537 B
TypeScript
21 lines
537 B
TypeScript
import {
|
|
asNullableRecord,
|
|
hasNonEmptyString as sharedHasNonEmptyString,
|
|
isRecord,
|
|
} from "openclaw/plugin-sdk/text-runtime";
|
|
|
|
export { asNullableRecord as asRecord, isRecord };
|
|
|
|
export const hasNonEmptyString = sharedHasNonEmptyString;
|
|
|
|
export function normalizeString(value: unknown): string | undefined {
|
|
if (typeof value === "string") {
|
|
const trimmed = value.trim();
|
|
return trimmed || undefined;
|
|
}
|
|
if (typeof value === "number" || typeof value === "boolean") {
|
|
return String(value);
|
|
}
|
|
return undefined;
|
|
}
|