Files
linkwarden/lib/client/avatarExists.ts
T
Daniel d008c441b7 Feat/import export (#136)
* added import/export functionality
2023-08-10 12:16:44 -04:00

5 lines
209 B
TypeScript

export default async function avatarExists(fileUrl: string): Promise<boolean> {
const response = await fetch(fileUrl, { method: "HEAD" });
return !(response.headers.get("content-type") === "text/html");
}