def ts.read

bend-kit-webhooks@0.11.0.1 · webhooks.bend:82

import bend-kit-webhooks@0.11.0.1/webhooks.bend as Webhooks
import Base
import bend-kit-int@0.2.0.0/int.bend as Int

82# Unix seconds: 1 to 18 ASCII digits, no sign, so the parse never overflows.
83def ts.read(+s: String) -> Result<&1, &1, Err, Int.I64>:
84  +n = String.length(s)
85  ts.some(Bool.and(Bool.and(Nat.is_lt(0n, n), Nat.is_le(n, 18n)), digits(s)), Int.I64.read(s))

Uses (11)

Used by (2)