Skip to content
Source
Sign inSign up
pingdotgg/t3code
Open History to see the last commit

RenderErrorBoundary.logic.ts

11 lines338 Bytes

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 );