mirror of
https://github.com/openclaw/openclaw.git
synced 2026-04-20 21:51:28 +00:00
refactor: dedupe trim string helpers
This commit is contained in:
@@ -1,11 +1,10 @@
|
||||
import { normalizeOptionalString } from "./string-coerce.js";
|
||||
|
||||
export function coerceIdentityValue(
|
||||
value: string | undefined,
|
||||
maxLength: number,
|
||||
): string | undefined {
|
||||
if (typeof value !== "string") {
|
||||
return undefined;
|
||||
}
|
||||
const trimmed = value.trim();
|
||||
const trimmed = normalizeOptionalString(value);
|
||||
if (!trimmed) {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user