• Construct a Codec<I, O> from functions that either returns the encoded/decoded as a Right value or throws an error that will result in a Left value

    Generic

    I - type of input

    Generic

    O - type of output

    Type Parameters

    • I

    • O

    Parameters

    • config: {
          decode: ((input: O) => I);
          encode: ((input: I) => O);
      }
      • decode: ((input: O) => I)
          • (input: O): I
          • Parameters

            • input: O

            Returns I

      • encode: ((input: I) => O)
          • (input: I): O
          • Parameters

            • input: I

            Returns O

    Returns Codec<I, O, Error>

Generated using TypeDoc