def cookie.max_age.at
import bend-kit-http@0.38.2.0/http.bend as Httpimport Base
import bend-kit-time@0.3.0.0/time.bend as Time
2201# Zero or less is the earliest time, so the cookie is already expired.
2202def cookie.max_age.at(+now: Time.Instant, m: Maybe<&2, U32>) -> Maybe<&2, Time.Instant>:
2203 match m:
2204 case None{}:
2205 None{}
2206 case Some{+s}:
2207 Some{Bool.pick(Time.Instant, U32.is_eq(s, 0), Time.Instant.epoch(), cookie.later(now, U32.min(s, cookie.limit())))}