MCPcopy Index your code
hub / github.com/anomalyco/opencode / unit

Function unit

packages/opencode/src/session/retry.ts:100–100  ·  view source on GitHub ↗
(value: number, name: string)

Source from the content-addressed store, hash-verified

98 const hours = Math.floor((seconds % 86_400) / 3_600)
99 const minutes = Math.ceil((seconds % 3_600) / 60)
100 const unit = (value: number, name: string) => `${value} ${name}${value === 1 ? "" : "s"}`
101
102 if (days > 0) return hours > 0 ? `${unit(days, "day")} ${unit(hours, "hour")}` : unit(days, "day")
103 if (hours > 0) return minutes > 0 ? `${unit(hours, "hour")} ${unit(minutes, "minute")}` : unit(hours, "hour")

Callers 1

retryableFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected