@jeremyckahn/farmhand
Version:
A farming game
14 lines (12 loc) • 306 B
text/typescript
import { memoize } from './memoize.js'
/**
* @param {{ cropTimeline: number[] }} crop
* @returns {number}
*/
export const getCropLifecycleDuration = memoize(
({ cropTimeline }: { cropTimeline: number[] }) => {
return cropTimeline.reduce((acc, value) => {
return acc + value
}, 0)
}
)