Files
CRM_Montzar/apps/web/src/lib/spoken-text.ts
T
MahdiandCursor 7757c0837d Add Ask Mento, customer mood, and Pipecat speech-to-text.
Ship assistant answers, contact moods, voice dictation, and the related CRM UI so these can be deployed to production.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-03 14:20:55 +03:30

9 lines
314 B
TypeScript

export function appendSpokenText(current: string, spoken: string): string {
const next = spoken.replace(/\s+/g, ' ').trim();
if (!next) return current;
const prev = current.replace(/\s+$/g, '');
if (!prev) return next;
const glue = /[\s\n]$/.test(current) ? '' : ' ';
return `${prev}${glue}${next}`;
}