import { KnownConfigKey } from "./registry"; const TRIMMABLE_GLOBAL_CONFIG_KEYS = new Set([ "commentMailFromEmail", "commentSmtpHost", "commentSmtpUser", "commentSmtpPass", ]); export function normalizeGlobalConfigValue(key: K, value: unknown): unknown { if (typeof value !== "string") { return value; } if (key === "siteName" || TRIMMABLE_GLOBAL_CONFIG_KEYS.has(key)) { return value.trim(); } return value; }