• Decode the value to an object. This implies nothing about the value that is being decoded, which can be anything. You could take a "plain" integer and "lift" it into an object.

    Type Parameters

    • O

    Parameters

    • layout: ObjectLayout<O>

      Properties you want the object to have

    Returns Decoder<O>

    Example

    const decoder = Decode.object({
    value: Decode.integer,
    });

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

Generated using TypeDoc