summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Juraj Kapsz <github@jurajkapsz.sk> 2024-04-15 10:52:39 +0200
committerGravatar GitHub <noreply@github.com> 2024-04-15 16:52:39 +0800
commit4dbd545304d1a8af903c8c97f237eb55c988c40b (patch)
tree1867018c58b4f77cbbeab2924dbb6b1e27e21695
parenta4e7d6650d9a8bbc1669b74254640b4af72dc6a0 (diff)
downloadastro-4dbd545304d1a8af903c8c97f237eb55c988c40b.tar.gz
astro-4dbd545304d1a8af903c8c97f237eb55c988c40b.tar.zst
astro-4dbd545304d1a8af903c8c97f237eb55c988c40b.zip
fix: picture fallback check (#10783)
-rw-r--r--.changeset/modern-mugs-raise.md5
-rw-r--r--packages/astro/components/Picture.astro2
2 files changed, 6 insertions, 1 deletions
diff --git a/.changeset/modern-mugs-raise.md b/.changeset/modern-mugs-raise.md
new file mode 100644
index 000000000..0796acf9f
--- /dev/null
+++ b/.changeset/modern-mugs-raise.md
@@ -0,0 +1,5 @@
+---
+"astro": patch
+---
+
+Fixes Picture component specialFormatsFallback fallback check
diff --git a/packages/astro/components/Picture.astro b/packages/astro/components/Picture.astro
index f23ab6ccc..6dcc50c8e 100644
--- a/packages/astro/components/Picture.astro
+++ b/packages/astro/components/Picture.astro
@@ -45,7 +45,7 @@ let resultFallbackFormat = fallbackFormat ?? defaultFallbackFormat;
if (
!fallbackFormat &&
isESMImportedImage(originalSrc) &&
- originalSrc.format in specialFormatsFallback
+ (specialFormatsFallback as ReadonlyArray<string>).includes(originalSrc.format)
) {
resultFallbackFormat = originalSrc.format;
}