Rename types.js -> Seconds.ts

This commit is contained in:
Rene Saarsoo 2020-09-25 09:33:37 +03:00
parent 46b2c1198f
commit 6170796433
8 changed files with 7 additions and 7 deletions

View File

@ -1,5 +1,5 @@
import { IntervalType } from "./parser/tokenizer"; import { IntervalType } from "./parser/tokenizer";
import { Seconds } from "./types"; import { Seconds } from "./Seconds";
export type Workout = { export type Workout = {
name: string; name: string;

View File

@ -1,6 +1,6 @@
import { Interval } from "./ast"; import { Interval } from "./ast";
import { detectRepeats } from "./detectRepeats"; import { detectRepeats } from "./detectRepeats";
import { Seconds } from "./types"; import { Seconds } from "./Seconds";
describe("detectRepeats()", () => { describe("detectRepeats()", () => {
it("does nothing with empty array", () => { it("does nothing with empty array", () => {

View File

@ -1,6 +1,6 @@
import { eqProps, flatten, zip } from "ramda"; import { eqProps, flatten, zip } from "ramda";
import { Interval, Comment } from "./ast"; import { Interval, Comment } from "./ast";
import { Seconds } from "./types"; import { Seconds } from "./Seconds";
export type RepeatedInterval = { export type RepeatedInterval = {
type: "repeat"; type: "repeat";

View File

@ -1,5 +1,5 @@
import { Interval, Workout, Comment } from "../ast"; import { Interval, Workout, Comment } from "../ast";
import { Seconds } from "../types"; import { Seconds } from "../Seconds";
import { ParseError } from "./ParseError"; import { ParseError } from "./ParseError";
import { SourceLocation, Token } from "./tokenizer"; import { SourceLocation, Token } from "./tokenizer";

View File

@ -1,6 +1,6 @@
import { map, sum } from "ramda"; import { map, sum } from "ramda";
import { Interval } from "../ast"; import { Interval } from "../ast";
import { Seconds } from "../types"; import { Seconds } from "../Seconds";
export const totalDuration = (intervals: Interval[]): Seconds => export const totalDuration = (intervals: Interval[]): Seconds =>
new Seconds(sum(map((interval) => interval.duration.value, intervals))); new Seconds(sum(map((interval) => interval.duration.value, intervals)));

View File

@ -1,5 +1,5 @@
import { Interval } from "../ast"; import { Interval } from "../ast";
import { Seconds } from "../types"; import { Seconds } from "../Seconds";
// Training Stress Score formula from Training and Racing with a Power Meter: // Training Stress Score formula from Training and Racing with a Power Meter:
// //

View File

@ -1,4 +1,4 @@
import { Seconds } from "../types"; import { Seconds } from "../Seconds";
// Training Stress Score formula from Training and Racing with a Power Meter: // Training Stress Score formula from Training and Racing with a Power Meter:
// //