MCPcopy Index your code
hub / github.com/CodebuffAI/codebuff / trimNewlines

Function trimNewlines

cli/src/components/blocks/block-helpers.ts:2–4  ·  view source on GitHub ↗
(str: string)

Source from the content-addressed store, hash-verified

1
2export function trimNewlines(str: string): string {
3 return str.replace(/^\n+|\n+$/g, '')
4}
5
6export function sanitizePreview(text: string): string {
7 return text.replace(/[#*_`~\[\]()]/g, '').trim()

Callers 3

single-block.tsxFile · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected