Rework of constants and some additional tests

This commit is contained in:
Jonathan Putney
2020-01-15 12:21:57 -05:00
parent eaa80394a7
commit 7882608fb6
23 changed files with 766 additions and 578 deletions

View File

@@ -143,10 +143,10 @@ export function addTwoDurations(
first: String,
second: String,
durationRegex: RegExp) {
const firstSeconds = getDurationAsSeconds(first, durationRegex);
const secondSeconds = getDurationAsSeconds(second, durationRegex);
return getSecondsAsISODuration(firstSeconds + secondSeconds);
return getSecondsAsISODuration(
getDurationAsSeconds(first, durationRegex) +
getDurationAsSeconds(second, durationRegex),
);
}
/**
@@ -161,9 +161,11 @@ export function addHHMMSSTimeStrings(
first: String,
second: String,
timeRegex: RegExp) {
const firstSeconds = getTimeAsSeconds(first, timeRegex);
const secondSeconds = getTimeAsSeconds(second, timeRegex);
return getSecondsAsHHMMSS(firstSeconds + secondSeconds);
return getSecondsAsHHMMSS(
getTimeAsSeconds(first, timeRegex) +
getTimeAsSeconds(
second, timeRegex),
);
}
/**