mirror of
https://github.com/openclaw/openclaw.git
synced 2026-04-16 19:51:11 +00:00
refactor: dedupe shared string predicates
This commit is contained in:
@@ -9,3 +9,7 @@ export function normalizeNullableString(value: unknown): string | null {
|
||||
export function normalizeOptionalString(value: unknown): string | undefined {
|
||||
return normalizeNullableString(value) ?? undefined;
|
||||
}
|
||||
|
||||
export function hasNonEmptyString(value: unknown): value is string {
|
||||
return typeof value === "string" && value.trim().length > 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user