@metreeca/http - v0.1.1
    Preparing search index...

    Function parseDuration

    • Parses a duration field value.

      Note

      A duration a peer states is a plain count of seconds, so a sign, a decimal point or an exponent marks a value no peer is required to understand: it is reported as missing rather than repaired, leaving the consumer to decide what to make of it.

      However far ahead a peer places a deadline, the duration reported stays within the range every recipient is required to handle, so it is always safe to add to a clock reading.

      Parameters

      • value: Nullable<string>

        The field value to be parsed, possibly missing

      Returns number | undefined

      The duration value states, in milliseconds, never negative and never longer than roughly sixty-eight years; undefined if value is missing or states anything but a bare count of seconds