MCPcopy Create free account
hub / github.com/Superflows-AI/superflows / removeRepetition

Function removeRepetition

lib/embed-docs/utils.ts:257–260  ·  view source on GitHub ↗
(str: string)

Source from the content-addressed store, hash-verified

255}
256
257export function removeRepetition(str: string): string {
258 const regex = /^(.*?)(?:\s)?\1$/;
259 return str.replace(regex, "$1");
260}
261
262export function findHeading(text: string): { text: string; heading: string } {
263 const lines = text.split("\n");

Callers 2

utils.test.tsFile · 0.90
splitTextByHeadersFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected