MCPcopy Index your code
hub / github.com/Linen-dev/linen.dev / cleanUp

Function cleanUp

packages/integration-email/src/helper/parser.ts:9–15  ·  view source on GitHub ↗
(text: string, quotedRegex: RegExp)

Source from the content-addressed store, hash-verified

7const quotedSpanishRegex = /\n*El.*<?\n?.*>?.*\n?escribió:\n?/;
8
9function cleanUp(text: string, quotedRegex: RegExp) {
10 const quoted = text.match(quotedRegex);
11 if (!quoted || !quoted.length) return text;
12 const splitBy = quoted.shift();
13 if (!splitBy) return text;
14 return text.split(splitBy).shift()?.trim() || text;
15}
16
17export function cleanUpQuotedEmail(text: string) {
18 return cleanUp(cleanUp(text, quotedSpanishRegex), quotedRegex);

Callers 1

cleanUpQuotedEmailFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected