MCPcopy Index your code
hub / github.com/getsentry/sentry-javascript / truncate

Function truncate

packages/core/src/utils/sql.ts:126–133  ·  view source on GitHub ↗
(summary: string)

Source from the content-addressed store, hash-verified

124}
125
126function truncate(summary: string): string {
127 if (summary.length <= MAX_SUMMARY_LENGTH) {
128 return summary;
129 }
130 const truncated = summary.substring(0, MAX_SUMMARY_LENGTH);
131 const lastSpace = truncated.lastIndexOf(' ');
132 return lastSpace > 0 ? truncated.substring(0, lastSpace) : truncated;
133}

Callers 2

cacheResponseHookFunction · 0.90
getSqlQuerySummaryFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected