@epic-web/workshop-utils 6.51.1 → 6.52.0

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.
@@ -416,7 +416,12 @@ async function _getApps({ timings, request, } = {}) {
416
416
  }
417
417
  }
418
418
  // at this point, we know that a and b are different types...
419
- if (isProblemApp(a)) {
419
+ // Both should be problem or solution apps at this point
420
+ const aIsProblem = isProblemApp(a);
421
+ const aIsSolution = isSolutionApp(a);
422
+ const bIsProblem = isProblemApp(b);
423
+ const bIsSolution = isSolutionApp(b);
424
+ if (aIsProblem && bIsSolution) {
420
425
  if (a.exerciseNumber === b.exerciseNumber) {
421
426
  return a.stepNumber <= b.stepNumber ? 1 : -1;
422
427
  }
@@ -424,7 +429,7 @@ async function _getApps({ timings, request, } = {}) {
424
429
  return a.exerciseNumber <= b.exerciseNumber ? 1 : -1;
425
430
  }
426
431
  }
427
- if (isSolutionApp(a)) {
432
+ if (aIsSolution && bIsProblem) {
428
433
  if (a.exerciseNumber === b.exerciseNumber) {
429
434
  return a.stepNumber < b.stepNumber ? -1 : 1;
430
435
  }
@@ -432,7 +437,10 @@ async function _getApps({ timings, request, } = {}) {
432
437
  return a.exerciseNumber < b.exerciseNumber ? -1 : 1;
433
438
  }
434
439
  }
435
- console.error('unhandled sorting case', a, b);
440
+ console.error('unhandled sorting case', {
441
+ a: { type: a.type, name: a.name, isProblem: aIsProblem, isSolution: aIsSolution },
442
+ b: { type: b.type, name: b.name, isProblem: bIsProblem, isSolution: bIsSolution },
443
+ });
436
444
  return 0;
437
445
  });
438
446
  return sortedApps;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@epic-web/workshop-utils",
3
- "version": "6.51.1",
3
+ "version": "6.52.0",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },