@xynogen/pix-data 0.2.4 → 0.2.5

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/package.json +1 -1
  2. package/src/data.ts +4 -2
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xynogen/pix-data",
3
- "version": "0.2.4",
3
+ "version": "0.2.5",
4
4
  "description": "Pi extension — shared model data layer (models.dev + BenchLM), cached at ~/.cache/pi",
5
5
  "type": "module",
6
6
  "main": "src/index.ts",
package/src/data.ts CHANGED
@@ -551,7 +551,7 @@ function lookupBenchlmScore(
551
551
 
552
552
  // Best entry = highest overallScore. Sort by score desc, then by slug
553
553
  // length asc (prefer base name over suffix variants on a tie).
554
- const best = [...candidates].sort((a, b) => {
554
+ const sorted = [...candidates].sort((a, b) => {
555
555
  const sa = a.overallScore ?? -Infinity;
556
556
  const sb = b.overallScore ?? -Infinity;
557
557
  if (sa !== sb) return sb - sa;
@@ -559,7 +559,9 @@ function lookupBenchlmScore(
559
559
  normalizeBenchlmName(a.model).length -
560
560
  normalizeBenchlmName(b.model).length
561
561
  );
562
- })[0];
562
+ });
563
+ const best = sorted[0];
564
+ if (!best) return null;
563
565
  return best.overallScore ?? null;
564
566
  }
565
567