mirror of
https://github.com/moltbot/moltbot.git
synced 2026-04-25 23:47:20 +00:00
refactor: dedupe shared string predicates
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
export { asNullableRecord as asRecord } from "openclaw/plugin-sdk/text-runtime";
|
||||
export { formatErrorMessage } from "openclaw/plugin-sdk/error-runtime";
|
||||
|
||||
export function normalizeTrimmedString(value: unknown): string | undefined {
|
||||
if (typeof value !== "string") {
|
||||
@@ -7,7 +8,3 @@ export function normalizeTrimmedString(value: unknown): string | undefined {
|
||||
const trimmed = value.trim();
|
||||
return trimmed.length > 0 ? trimmed : undefined;
|
||||
}
|
||||
|
||||
export function formatErrorMessage(err: unknown): string {
|
||||
return err instanceof Error ? err.message : String(err);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user