From 75e314f6b0546aa5dbfaaf8a05d57afcf50d5476 Mon Sep 17 00:00:00 2001 From: Hiago Silva <97215740+Huntterxx@users.noreply.github.com> Date: Sun, 15 Mar 2026 14:30:14 -0300 Subject: [PATCH] style: fix formatter issues --- src/tts/tts-core.ts | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/tts/tts-core.ts b/src/tts/tts-core.ts index d8aff2d3694..4472b1e38af 100644 --- a/src/tts/tts-core.ts +++ b/src/tts/tts-core.ts @@ -704,8 +704,9 @@ export async function edgeTTS(params: { }): Promise { const { text, outputPath, config, timeoutMs } = params; - const safeText = - text && text.trim().length > 0 ? text : " "; + if (!text || text.trim().length === 0) { + throw new Error("TTS text cannot be empty"); + } const tts = new EdgeTTS({ voice: config.voice, @@ -719,12 +720,12 @@ export async function edgeTTS(params: { timeout: config.timeoutMs ?? timeoutMs, }); - await tts.ttsPromise(safeText, outputPath); + await tts.ttsPromise(text, outputPath); let { size } = statSync(outputPath); if (size === 0) { - await tts.ttsPromise(safeText, outputPath); + await tts.ttsPromise(text, outputPath); ({ size } = statSync(outputPath)); if (size === 0) {