Fix bulk env var parsing (#482)

This commit is contained in:
Gregory Schier
2026-06-26 21:58:38 -07:00
committed by GitHub
parent 84b89e2708
commit fd0ca6d455
6 changed files with 77 additions and 12 deletions
+7 -4
View File
@@ -247,10 +247,13 @@ function parseOklch(
);
if (match == null) return null;
const lightness = parseOklchLightness(match[1]);
const chroma = parseCssNumber(match[2], 1);
const hue = normalizeHue(parseCssNumber(match[3].replace(/deg$/i, ""), 1));
const alpha = parseCssNumber(match[4] ?? match[5] ?? "1", 1);
const [, lightnessValue, chromaValue, hueValue, slashAlpha, commaAlpha] = match;
if (lightnessValue == null || chromaValue == null || hueValue == null) return null;
const lightness = parseOklchLightness(lightnessValue);
const chroma = parseCssNumber(chromaValue, 1);
const hue = normalizeHue(parseCssNumber(hueValue.replace(/deg$/i, ""), 1));
const alpha = parseCssNumber(slashAlpha ?? commaAlpha ?? "1", 1);
if (
!Number.isFinite(lightness) ||