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