Open History to see the last commit
1import { splitsSurrogatePair } from "@t3tools/shared/assistantCitations";
2
3const PREVIEW_LIMIT = 300;
4
5export function errorDetailsPreview(details: string) {
6 const firstLine = details.split("\n", 1)[0] ?? "";
7 return firstLine.slice(
8 0,
9 splitsSurrogatePair(firstLine, PREVIEW_LIMIT) ? PREVIEW_LIMIT - 1 : PREVIEW_LIMIT,
10 );
11}