Skip to content

Commit

Permalink
fix: types
Browse files Browse the repository at this point in the history
  • Loading branch information
AleksandrSl committed Apr 22, 2024
1 parent 6757de3 commit 0ec61ff
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/components/Recipe.astro
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ const { time, weight } = createPropertyFormatters(Astro.currentLocale)
const href = getRelativeLocaleUrl(locale, `/recipes/${recipe.method}`)
const formattedSteps = recipe.steps
?.reduce((acc, step, index) => {
?.reduce<{ description?: string; time: string; totalTime: number; water: number }[]>((acc, step, index) => {
acc.push({ ...step, totalTime: humanTimeToSeconds(step.time) + (index > 0 ? acc[index - 1].totalTime : 0) })
return acc
}, [] as { description?: string; time: string; totalTime: number; water: number }[])
}, [])
.map(step => ({
...step,
time: time(step.time),
Expand Down

0 comments on commit 0ec61ff

Please sign in to comment.