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>
9 lines
314 B
TypeScript
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}`;
|
|
}
|