Function intersection

  • Creates an intersection decoder from an array of decoders. Intersection decoder checks if input value matches all provided decoders.

    Example

    const fooDecoder = D.object({ foo: D.string });
    const barDecoder = D.object({ bar: D.string });
    // Creates a union which will successfully decode { foo: 'a', bar: 'b' }
    const unionDecoder = D.union([barDecoder, fooDecoder])

    Type Parameters

    • A

    • B

    • C

    • I = unknown

    Parameters

    Returns Decoder<A & B & C, I>

  • Type Parameters

    • A

    • B

    • I = unknown

    Parameters

    Returns Decoder<A & B, I>

  • Type Parameters

    • A

    • I = unknown

    Parameters

    Returns Decoder<A, I>

Generated using TypeDoc