• Access the given property of an object.

    Type Parameters

    • T

    Parameters

    • name: string

      Name of the property

    • child: Decoder<T>

      The decoder to run on the value of that property

    Returns Decoder<T>

    Example

    const decoder = Decode.field('value', Decode.integer);

    decode(decoder, { value: 42 }) === 42
    decode(decoder, {}) // Fails
    decode(decoder, 42) // Fails

Generated using TypeDoc