feat: Add communities
This commit is contained in:
1 parent
5be28724b8
commit
5f674d4691
4 files changed
+32
-4
No files matched your search
+11
-2
@@ -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')
|
||||
}
|
||||
Reference in new issue
Block a user