fix: harden analytics writes and hide internal server errors from client
This commit is contained in:
1 parent
770b4d59d2
commit
129681ebd7
15 files changed
+217
-128
No files matched your search
@@ -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;
|
||||
}
|
||||
Reference in new issue
Block a user