Skip to content

Commit 0668820

Browse files
Update src/utils.ts
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
1 parent 47215f4 commit 0668820

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

src/utils.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -237,9 +237,8 @@ export function convertToTelegramButtons(buttons?: Button[] | null): InlineKeybo
237237
/**
238238
* Clean text by removing all NULL (\u0000) characters
239239
* @param {string | undefined | null} text - The text to clean
240-
* @returns {string} The cleaned text
241-
*/
242240
export function cleanText(text: string | undefined | null): string {
243241
if (!text) return '';
244-
return text.replace(/\u0000/g, '');
242+
// Avoid control char in regex literal; lint-friendly
243+
return text.split('\u0000').join('');
245244
}

0 commit comments

Comments
 (0)