@govtechsg/oobee 0.10.88 → 0.10.89

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -409,8 +409,10 @@ const buildColorContrastMessage = (node) => {
409
409
  data.expectedContrastRatio;
410
410
  if (!hasContrastData)
411
411
  return;
412
- const fgColor = data.fgColor || 'unknown foreground';
413
- const bgColor = data.bgColor || 'unknown background';
412
+ if (!data.fgColor || !data.bgColor)
413
+ return;
414
+ const fgColor = data.fgColor;
415
+ const bgColor = data.bgColor;
414
416
  const contrastRatio = String(data.contrastRatio ?? 'unknown');
415
417
  const fontSize = formatContrastFontSize(data.fontSize);
416
418
  const fontWeight = data.fontWeight || 'normal';
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@govtechsg/oobee",
3
3
  "main": "dist/npmIndex.js",
4
- "version": "0.10.88",
4
+ "version": "0.10.89",
5
5
  "type": "module",
6
6
  "author": "Government Technology Agency <info@tech.gov.sg>",
7
7
  "bin": {
@@ -529,8 +529,10 @@ const buildColorContrastMessage = (node: NodeResultWithScreenshot): string | nul
529
529
 
530
530
  if (!hasContrastData) return;
531
531
 
532
- const fgColor = data.fgColor || 'unknown foreground';
533
- const bgColor = data.bgColor || 'unknown background';
532
+ if (!data.fgColor || !data.bgColor) return;
533
+
534
+ const fgColor = data.fgColor;
535
+ const bgColor = data.bgColor;
534
536
  const contrastRatio = String(data.contrastRatio ?? 'unknown');
535
537
  const fontSize = formatContrastFontSize(data.fontSize);
536
538
  const fontWeight = data.fontWeight || 'normal';