fix: soo many lint errors

This commit is contained in:
Max Richter
2025-11-03 00:03:27 +01:00
parent c13420c3ab
commit 696082250d
41 changed files with 373 additions and 500 deletions

View File

@@ -134,7 +134,7 @@ async function getLocalImage(
*/
async function storeLocalImage(
url: string,
content: ArrayBuffer,
content: Uint8Array<ArrayBuffer> | ArrayBuffer,
{ width, height }: { width?: number; height?: number } = {},
) {
const isValid = await verifyImage(new Uint8Array(content));
@@ -249,7 +249,7 @@ async function verifyImage(imageBuffer: Uint8Array): Promise<boolean> {
export async function getImageContent(
url: string,
{ width, height }: { width?: number; height?: number } = {},
): Promise<{ content: ArrayBuffer; mimeType: string }> {
): Promise<{ content: Uint8Array<ArrayBuffer>; mimeType: string }> {
log.debug("Getting image content", { url, width, height });
// Check if we have the image metadata in database
@@ -267,8 +267,8 @@ export async function getImageContent(
// Fetch and cache original if needed
if (!originalImage) {
const fetchedImage = await getRemoteImage(url);
await storeLocalImage(url, fetchedImage.buffer);
originalImage = new Uint8Array(fetchedImage.buffer);
await storeLocalImage(url, originalImage);
}
// Resize image