rename some files and add nip 94 widget
This commit is contained in:
@@ -1,3 +0,0 @@
|
||||
export function isImage(url: string) {
|
||||
return /\.(jpg|jpeg|gif|png|webp|avif)$/.test(url);
|
||||
}
|
||||
11
src/utils/nip94.ts
Normal file
11
src/utils/nip94.ts
Normal file
@@ -0,0 +1,11 @@
|
||||
export function fileType(url: string) {
|
||||
if (url.match(/\.(jpg|jpeg|gif|png|webp|avif)$/)) {
|
||||
return 'image';
|
||||
}
|
||||
|
||||
if (url.match(/\.(mp4|mov|webm|wmv|flv|mts|avi|ogv|mkv|mp3|m3u8)$/)) {
|
||||
return 'video';
|
||||
}
|
||||
|
||||
return 'link';
|
||||
}
|
||||
Reference in New Issue
Block a user