Function optional

  • Creates an optional decoder from a given decoder. Allows input values to be undefined.

    Example

    // Creates a decoder that accepts values of type string or undefined.
    const decoder = D.optional(D.string)

    Type Parameters

    • O

    • I = unknown

    Parameters

    Returns Decoder<O | undefined, I>

Generated using TypeDoc