Skip to content

Commit

Permalink
fix styles
Browse files Browse the repository at this point in the history
  • Loading branch information
ts-ign0re committed Aug 10, 2022
1 parent c2852a6 commit 300103f
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 9 deletions.
4 changes: 2 additions & 2 deletions src/__tests__/default-program.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@ describe('defaultProgram', () => {
expect(w2[0].weight).toBe(200);
expect(w2[1].weight).toBe(230);
expect(w2[2].weight).toBe(255);

expect(w3[0].weight).toBe(215);
expect(w3[1].weight).toBe(240);
expect(w3[2].weight).toBe(270);

expect(w4[0].weight).toBe(115);
expect(w4[1].weight).toBe(145);
expect(w4[2].weight).toBe(170);
Expand Down
2 changes: 1 addition & 1 deletion src/__tests__/jim-welder-program.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ describe('JimWendlerProgram', () => {
// 100kg
expect(JimWendlerProgram(100)[0][0].weight).toBe(60);
});
});
});
2 changes: 1 addition & 1 deletion src/__tests__/round-to-five.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ describe('roundToFive', () => {
expect(roundToFive(282.3)).toBe(280);
expect(roundToFive(164)).toBe(165);
});
});
});
6 changes: 3 additions & 3 deletions src/default-program.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { roundToFive } from './round-to-five';
export type ProgramScheme = Array<{
load: number[];
reps: string[];
}>
}>;
export type Program = { weight: number };
export type ProgramSchedule = Program[][];

Expand All @@ -18,7 +18,7 @@ export function defaultProgram(maxWeight: number, programScheme: ProgramScheme)

return programScheme.map((currentLoad, pp) => {
return currentLoad.load.map((loadInPercent, ii) => {
return ({ weight: roundToFive(Math.round(maxWeight * loadInPercent)), reps: programScheme[pp].reps[ii] });
return { weight: roundToFive(Math.round(maxWeight * loadInPercent)), reps: programScheme[pp].reps[ii] };
});
});
}
}
3 changes: 2 additions & 1 deletion src/jim-wendler-program.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,5 @@ const JimWendlerProgramLoad = [week1, week2, week3, week4];

const use90PercentAsDefaultMaxWeight = (maxWeight: number) => roundToFive(Math.round(maxWeight * 0.9));

export const JimWendlerProgram = (maxWeight: number) => defaultProgram(use90PercentAsDefaultMaxWeight(maxWeight), JimWendlerProgramLoad);
export const JimWendlerProgram = (maxWeight: number) =>
defaultProgram(use90PercentAsDefaultMaxWeight(maxWeight), JimWendlerProgramLoad);
2 changes: 1 addition & 1 deletion src/round-to-five.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
export function roundToFive(n: number): number {
return Math.round(n / 5) * 5;
}
}

0 comments on commit 300103f

Please sign in to comment.