fix: harden analytics writes and hide internal server errors from client

This commit is contained in:
Francis Cao committed 2026-06-22 22:07:07 -07:00
1 parent 770b4d59d2
commit 129681ebd7
15 files changed
+217 -128

No files matched your search

+7
View File
@@ -118,3 +118,10 @@ export function formatLongCurrency(value: number, currency: string, locale = 'en
return formatCurrency(n, currency, locale);
}
export function truncateString<T extends string | null | undefined>(
value: T,
maxLength: number,
): T extends string ? string : T {
return (value ? value.substring(0, maxLength) : value) as T extends string ? string : T;
}