openclaw
Version:
Multi-channel AI gateway with extensible messaging integrations
11 lines (10 loc) • 458 B
JavaScript
import { o as normalizeLowercaseStringOrEmpty } from "./string-coerce-1VuiLaaR.mjs";
//#region src/infra/net/hostname.ts
/** Normalize a hostname for policy comparisons. */
function normalizeHostname(hostname) {
const normalized = normalizeLowercaseStringOrEmpty(hostname).replace(/\.+$/, "");
if (normalized.startsWith("[") && normalized.endsWith("]")) return normalized.slice(1, -1);
return normalized;
}
//#endregion
export { normalizeHostname as t };