Improve formatting of main index.ts file
This commit is contained in:
parent
2871dae0ff
commit
6959537d9e
35
src/index.ts
35
src/index.ts
|
|
@ -13,31 +13,20 @@ console.log(`Parsing: ${filename}`);
|
||||||
|
|
||||||
const file = fs.readFileSync(filename, "utf8");
|
const file = fs.readFileSync(filename, "utf8");
|
||||||
|
|
||||||
const workout = parse(tokenize(file));
|
const { intervals } = parse(tokenize(file));
|
||||||
|
|
||||||
console.log(workout.intervals);
|
const duration = totalDuration(intervals);
|
||||||
|
const avgIntensity = averageIntensity(intervals);
|
||||||
|
const normIntensity = normalizedIntensity(intervals);
|
||||||
|
|
||||||
console.log();
|
console.log(intervals);
|
||||||
console.log("Total TSS: " + tss(workout.intervals).toFixed());
|
|
||||||
|
|
||||||
console.log();
|
console.log(`
|
||||||
console.log(
|
Total duration: ${(duration / 60).toFixed()} minutes
|
||||||
`Total duration: ${(totalDuration(workout.intervals) / 60).toFixed()} minutes`
|
|
||||||
);
|
|
||||||
|
|
||||||
console.log();
|
Average intensity: ${(avgIntensity * 100).toFixed()}%
|
||||||
console.log(
|
Normalized intensity: ${(normIntensity * 100).toFixed()}%
|
||||||
`Average intensity: ${(averageIntensity(workout.intervals) * 100).toFixed()}%`
|
|
||||||
);
|
|
||||||
console.log(
|
|
||||||
`Normalized intensity: ${(
|
|
||||||
normalizedIntensity(workout.intervals) * 100
|
|
||||||
).toFixed()}%`
|
|
||||||
);
|
|
||||||
|
|
||||||
console.log(
|
TSS #1: ${tss(intervals).toFixed()}
|
||||||
`TSS: ${tss2(
|
TSS #2: ${tss2(duration, normIntensity).toFixed()}
|
||||||
totalDuration(workout.intervals),
|
`);
|
||||||
normalizedIntensity(workout.intervals)
|
|
||||||
)}`
|
|
||||||
);
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue