This commit is contained in:
Timothy Jaeryang Baek
2024-12-24 22:16:22 -07:00
parent e39617b1c0
commit d93107d1d6
2 changed files with 30 additions and 3 deletions

View File

@@ -8,6 +8,9 @@ import { TTS_RESPONSE_SPLIT } from '$lib/types';
// Helper functions
//////////////////////////
export const sleep = (ms: number) => new Promise((resolve) => setTimeout(resolve, ms));
function escapeRegExp(string: string): string {
return string.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
}