This commit is contained in:
Timothy Jaeryang Baek
2025-09-24 11:36:17 -05:00
parent 316f1d6ff0
commit 05732de898
3 changed files with 14 additions and 8 deletions
+9
View File
@@ -799,6 +799,15 @@ export const isValidHttpUrl = (string: string) => {
return url.protocol === 'http:' || url.protocol === 'https:';
};
export const isYoutubeUrl = (url: string) => {
return (
url.startsWith('https://www.youtube.com') ||
url.startsWith('https://youtu.be') ||
url.startsWith('https://youtube.com') ||
url.startsWith('https://m.youtube.com')
);
};
export const removeEmojis = (str: string) => {
// Regular expression to match emojis
const emojiRegex = /[\uD800-\uDBFF][\uDC00-\uDFFF]|\uD83C[\uDC00-\uDFFF]|\uD83D[\uDC00-\uDE4F]/g;