Skip to content

The open alternative to Salesforce, designed for AI.

200 B
Raw Blame
export const normalizeMessageText = (text: string): string =>
  text
    .replace(/\r\n?/g, '\n')
    .replace(/ /g, ' ')
    .replace(/[^\S\n]+$/gm, '')
    .replace(/\n{3,}/g, '\n\n')
    .trim();