chore: monorepo
This commit is contained in:
15
packages/utils/src/nip94.ts
Normal file
15
packages/utils/src/nip94.ts
Normal file
@@ -0,0 +1,15 @@
|
||||
export function fileType(url: string) {
|
||||
if (url.match(/\.(jpg|jpeg|gif|png|webp|avif|tiff)$/)) {
|
||||
return "image";
|
||||
}
|
||||
|
||||
if (url.match(/\.(mp4|mov|webm|wmv|flv|mts|avi|ogv|mkv)$/)) {
|
||||
return "video";
|
||||
}
|
||||
|
||||
if (url.match(/\.(mp3|ogg|wav)$/)) {
|
||||
return "audio";
|
||||
}
|
||||
|
||||
return "link";
|
||||
}
|
||||
Reference in New Issue
Block a user