hevy-shared 1.0.728 → 1.0.729
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/built/hevyTrainer.js +9 -2
- package/package.json +1 -1
package/built/hevyTrainer.js
CHANGED
|
@@ -76,7 +76,7 @@ const isEquipmentCompatible = (exercise, allowedEquipments) => {
|
|
|
76
76
|
allowedEquipments.includes('barbell')));
|
|
77
77
|
};
|
|
78
78
|
/**
|
|
79
|
-
* Checks if
|
|
79
|
+
* Checks if the routine barbell exercise limit is exceeded
|
|
80
80
|
*
|
|
81
81
|
* - We allow up to 2 barbell exercises per routine
|
|
82
82
|
* - Unless the user ONLY has barbell as an allowed equipment
|
|
@@ -235,8 +235,15 @@ const pickExerciseForPrescription = (params) => {
|
|
|
235
235
|
if (exercise)
|
|
236
236
|
return exercise;
|
|
237
237
|
// Pass 5: Find exercise regardless of exercise category (isolation or compound)
|
|
238
|
-
// So search for compound if the exercise category is isolation, and vice versa
|
|
239
238
|
exercise = findMatchingExercise(exercises, Object.assign(Object.assign({}, criteria), { exerciseCategory: criteria.exerciseCategory === 'isolation' ? 'compound' : 'isolation' }), routineContext);
|
|
239
|
+
if (exercise)
|
|
240
|
+
return exercise;
|
|
241
|
+
// Pass 6: Find exercises where the prescription muscle group
|
|
242
|
+
// is in the exercise's other muscles
|
|
243
|
+
const otherMuscles = Object.values(sortedExercises)
|
|
244
|
+
.flat()
|
|
245
|
+
.filter((e) => e.other_muscles.includes(criteria.muscleGroup));
|
|
246
|
+
exercise = findMatchingExercise(otherMuscles, criteria, routineContext);
|
|
240
247
|
return exercise;
|
|
241
248
|
};
|
|
242
249
|
exports.pickExerciseForPrescription = pickExerciseForPrescription;
|