fitness-progression-calculator
Version:
Workout progression calculator for fitness applications
66 lines (65 loc) • 2.82 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.calculateHypertrophyProgression = calculateHypertrophyProgression;
const constants_1 = require("../constants");
const utils_1 = require("../utils");
const strength_1 = require("./strength");
function calculateHypertrophyProgression(data, settings) {
// Compound movements always use weight-only progression
// This prevents dangerous volume spikes on heavy exercises
if (data.is_compound) {
return (0, strength_1.calculateStrengthProgression)(data, settings);
}
// Isolation exercises use rep-based progression
const increment = (0, utils_1.getIncrement)(data.equipment_type, settings);
const atMaxReps = data.reps >= constants_1.MAX_REPS;
let newWeight = data.weight;
let newReps = data.reps;
if (atMaxReps) {
// Cycling logic - at rep ceiling
switch (data.rating) {
case 1: // Very Easy - aggressive cycle
newWeight = data.weight + (increment * 2);
newReps = (0, utils_1.calculateCycleReps)(data.reps, data.weight, newWeight, constants_1.VOLUME_FACTOR_AGGRESSIVE);
break;
case 2: // Easy - standard cycle
newWeight = data.weight + increment;
newReps = (0, utils_1.calculateCycleReps)(data.reps, data.weight, newWeight, constants_1.VOLUME_FACTOR_AGGRESSIVE);
break;
case 3: // Moderate - conservative cycle
newWeight = data.weight + increment;
newReps = (0, utils_1.calculateCycleReps)(data.reps, data.weight, newWeight, constants_1.VOLUME_FACTOR_CONSERVATIVE);
break;
case 4: // Hard - no change
break;
case 5: // Too Hard - reduce weight, keep reps
newWeight = Math.max(0, data.weight - increment);
break;
}
}
else {
// Standard progression - not at ceiling
switch (data.rating) {
case 1: // Very Easy - weight AND reps
newWeight = data.weight + increment;
newReps = data.reps + 1;
break;
case 2: // Easy - reps + 2
newReps = Math.min(data.reps + 2, constants_1.MAX_REPS);
break;
case 3: // Moderate - reps + 1
newReps = Math.min(data.reps + 1, constants_1.MAX_REPS);
break;
case 4: // Hard - no change
break;
case 5: // Too Hard - reduce weight
newWeight = Math.max(0, data.weight - increment);
break;
}
}
return {
newWeight,
newReps,
suggestion: (0, utils_1.checkExerciseTransition)(data.exerciseId, newWeight),
};
}