talentdeficit/jsx — pull request #17 by devinus (2012-06-08 15:38:25+00:00)
Title: Allow tuple values in a list to be pre-encoded without assuming it's an object

Before, if a list value contained a tuple it would skip pre-encoding and assume it's an object. With this patch, the tuple has to match the object "contract" (key-value pair, with key being an atom or binary).

This allows people to pre-encode tuples or records in a list. The larger problem is that people may want to pre-encode tuples that match the object "contract," e.g.:

```erlang
pre_encode({foo, 1}) ->
{bar, 1};
pre_encode(Value) ->
Value.

This can also happen if one is pre-encoding records with one field, e.g.: