@emailens/engine 0.8.3 → 0.8.4

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.
package/dist/index.cjs CHANGED
@@ -6420,10 +6420,13 @@ function generateCompatibilityScore(warnings) {
6420
6420
  const result = {};
6421
6421
  for (const client of EMAIL_CLIENTS) {
6422
6422
  const clientWarnings = warnings.filter((w) => w.client === client.id);
6423
- const errors = clientWarnings.filter((w) => w.severity === "error").length;
6424
- const warns = clientWarnings.filter((w) => w.severity === "warning").length;
6425
- const info = clientWarnings.filter((w) => w.severity === "info").length;
6426
- const score = Math.max(0, Math.min(100, 100 - errors * 15 - warns * 5 - info * 1));
6423
+ const errorProps = new Set(clientWarnings.filter((w) => w.severity === "error").map((w) => w.property));
6424
+ const warnProps = new Set(clientWarnings.filter((w) => w.severity === "warning").map((w) => w.property));
6425
+ const infoProps = new Set(clientWarnings.filter((w) => w.severity === "info").map((w) => w.property));
6426
+ const errors = errorProps.size;
6427
+ const warns = warnProps.size;
6428
+ const info = infoProps.size;
6429
+ const score = Math.max(0, Math.min(100, 100 - errors * 10 - warns * 3));
6427
6430
  result[client.id] = { score, errors, warnings: warns, info };
6428
6431
  }
6429
6432
  return result;