@svelte-vitals/core 0.22.0 → 0.22.1

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.
Files changed (2) hide show
  1. package/dist/index.js +5 -2
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -2665,6 +2665,9 @@ function locationOf(issue, route) {
2665
2665
  if (issue.location) return issue.line !== void 0 ? `${issue.location}:${issue.line}` : issue.location;
2666
2666
  return route ?? "-";
2667
2667
  }
2668
+ function messageWithRecommendation(issue) {
2669
+ return issue.recommendation ? `${issue.title} ${issue.recommendation}` : issue.title;
2670
+ }
2668
2671
  function flattenFindings(report) {
2669
2672
  const findings = [];
2670
2673
  for (const r of report.routes) {
@@ -2673,7 +2676,7 @@ function flattenFindings(report) {
2673
2676
  severity: issue.severity,
2674
2677
  id: issue.id,
2675
2678
  location: locationOf(issue, r.route),
2676
- message: issue.title
2679
+ message: messageWithRecommendation(issue)
2677
2680
  });
2678
2681
  }
2679
2682
  }
@@ -2682,7 +2685,7 @@ function flattenFindings(report) {
2682
2685
  severity: issue.severity,
2683
2686
  id: issue.id,
2684
2687
  location: locationOf(issue, void 0),
2685
- message: issue.title
2688
+ message: messageWithRecommendation(issue)
2686
2689
  });
2687
2690
  }
2688
2691
  return findings.map((f, index) => ({ f, index })).sort((a, b) => SEVERITY_RANK2[a.f.severity] - SEVERITY_RANK2[b.f.severity] || a.index - b.index).map(({ f }) => f);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@svelte-vitals/core",
3
- "version": "0.22.0",
3
+ "version": "0.22.1",
4
4
  "description": "Shared, runtime-agnostic core for svelte-vitals (types, rule engine, scorer, reporter).",
5
5
  "type": "module",
6
6
  "license": "MIT",