Reduce a tiny bit of duplication in the normalizeBlendMode helper

This commit is contained in:
Jonas Jenwald 2026-07-27 13:59:38 +02:00
parent 2ea8820d92
commit 63a0f285b8

View File

@ -140,12 +140,7 @@ function normalizeBlendMode(value, parsingArray = false) {
return "source-over"; return "source-over";
} }
if (!(value instanceof Name)) { if (value instanceof Name) {
if (parsingArray) {
return null;
}
return "source-over";
}
switch (value.name) { switch (value.name) {
case "Normal": case "Normal":
case "Compatible": case "Compatible":
@ -181,11 +176,9 @@ function normalizeBlendMode(value, parsingArray = false) {
case "Luminosity": case "Luminosity":
return "luminosity"; return "luminosity";
} }
if (parsingArray) {
return null;
}
warn(`Unsupported blend mode: ${value.name}`); warn(`Unsupported blend mode: ${value.name}`);
return "source-over"; }
return parsingArray ? null : "source-over";
} }
function addCachedImageOps( function addCachedImageOps(