@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.js CHANGED
@@ -6323,10 +6323,13 @@ function generateCompatibilityScore(warnings) {
6323
6323
  const result = {};
6324
6324
  for (const client of EMAIL_CLIENTS) {
6325
6325
  const clientWarnings = warnings.filter((w) => w.client === client.id);
6326
- const errors = clientWarnings.filter((w) => w.severity === "error").length;
6327
- const warns = clientWarnings.filter((w) => w.severity === "warning").length;
6328
- const info = clientWarnings.filter((w) => w.severity === "info").length;
6329
- const score = Math.max(0, Math.min(100, 100 - errors * 15 - warns * 5 - info * 1));
6326
+ const errorProps = new Set(clientWarnings.filter((w) => w.severity === "error").map((w) => w.property));
6327
+ const warnProps = new Set(clientWarnings.filter((w) => w.severity === "warning").map((w) => w.property));
6328
+ const infoProps = new Set(clientWarnings.filter((w) => w.severity === "info").map((w) => w.property));
6329
+ const errors = errorProps.size;
6330
+ const warns = warnProps.size;
6331
+ const info = infoProps.size;
6332
+ const score = Math.max(0, Math.min(100, 100 - errors * 10 - warns * 3));
6330
6333
  result[client.id] = { score, errors, warnings: warns, info };
6331
6334
  }
6332
6335
  return result;