From 9433975984e71fc69ea38e3c0180b9e0d1c15ae7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Fernandes?= Date: Wed, 5 Feb 2025 14:54:52 +0000 Subject: [PATCH] Adding webp to regex list. Added function return type for consistency with the rest of the functions (#7649) --- src/lib/media/util.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lib/media/util.ts b/src/lib/media/util.ts index 73f9748745..36b342204a 100644 --- a/src/lib/media/util.ts +++ b/src/lib/media/util.ts @@ -8,8 +8,8 @@ export function getDataUriSize(uri: string): number { return Math.round((uri.length * 3) / 4) } -export function isUriImage(uri: string) { - return /\.(jpg|jpeg|png).*$/.test(uri) +export function isUriImage(uri: string): boolean { + return /\.(jpg|jpeg|png|webp).*$/.test(uri) } export function blobToDataUri(blob: Blob): Promise {