lemmy-ui/src/server/utils/fetch-icon-png.ts
Alec Armbruster 9fc3da0264
Fix grave ReferenceError: fetch is not defined error (#1460)
* use cross-fetch

* remove from utils usage
2023-06-22 07:42:57 -04:00

7 lines
188 B
TypeScript

import fetch from "cross-fetch";
export async function fetchIconPng(iconUrl: string) {
return await fetch(iconUrl)
.then(res => res.blob())
.then(blob => blob.arrayBuffer());
}