mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-08 01:31:23 +00:00
8 lines
260 B
TypeScript
8 lines
260 B
TypeScript
export function normalizeHostname(hostname: string): string {
|
|
const normalized = hostname.trim().toLowerCase().replace(/\.$/, "");
|
|
if (normalized.startsWith("[") && normalized.endsWith("]")) {
|
|
return normalized.slice(1, -1);
|
|
}
|
|
return normalized;
|
|
}
|