• Decode an object with arbitrary keys and values of the same type T.

    Type Parameters

    • T

    Parameters

    • child: Decoder<T>

      Decoder to use for values

    Returns Decoder<{
        [key: string]: T;
    }>

    Example

    const raw = { en: 'Bread', fr: 'Pain', it: 'Pane' };
    const decoder = Decode.dict(Decode.string);

    decode(decoder, raw); // Works

    decode(decoder, { en: 128 }); // Fails

Generated using TypeDoc