Merge pull request #21642 from Snuffleupagus/normalizeBlendMode-shorten

Reduce a tiny bit of duplication in the `normalizeBlendMode` helper
This commit is contained in:
Jonas Jenwald 2026-07-27 19:02:26 +02:00 committed by GitHub
commit a03ec7e8c5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

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(