Package: effect
Module: Duration
Decodes a Input value into a Duration safely, returning
Option.none() if decoding fails.
Example (Safely decoding duration inputs)
import { Duration, Option } from "effect"
Duration.fromInput(1000).pipe(Option.map(Duration.toSeconds)) // Some(1)
Duration.fromInput("invalid" as any) // None
Signature
declare const fromInput: (u: Input) => Option.Option<Duration>
Since v4.0.0