ts.data.json - v4.2.1
    Preparing search index...

    Function flatMap

    • Chains a decoder into another decoder that depends on the decoded value.

      Type Parameters

      • T
      • O

      Parameters

      Returns Decoder<O>

      const adult = flatMap(number(), age =>
      age >= 18 ? succeed() : fail(`Age ${age} is less than 18`)
      );