feat: Add communities

This commit is contained in:
Xyphyn committed 2023-07-04 20:18:25 -07:00
1 parent 5be28724b8
commit 5f674d4691
4 files changed
+32 -4

No files matched your search

+11 -2
View File
@@ -1,2 +1,11 @@
export const isImage = (url: string | undefined) =>
/\.(jpeg|jpg|gif|png|svg|bmp|webp)$/i.test(url ?? '')
export const isImage = (url: string | undefined) => {
if (!url) return false
return /\.(jpeg|jpg|gif|png|svg|bmp|webp)$/i.test(new URL(url).pathname)
}
export const isVideo = (url: string | undefined) => {
if (!url) return false
return new URL(url).pathname.toLowerCase().endsWith('.mp4')
}