def cookie.expires.cap

bend-kit-http@0.38.2.0 · http.bend:2162

import bend-kit-http@0.38.2.0/http.bend as Http
import Base
import bend-kit-time@0.3.0.0/time.bend as Time

2162def cookie.expires.cap(+now: Time.Instant, m: Maybe<&2, Time.Instant>) -> Maybe<&2, Time.Instant>:
2163  match m:
2164    case None{}:
2165      None{}
2166    case Some{+t}:
2167      +lim = cookie.later(now, cookie.limit())
2168      Some{Bool.pick(Time.Instant, Cmp.is_lt(Time.Instant.cmp(lim, t)), lim, t)}

Uses (7)

Used by (1)