mirror of
https://github.com/valitydev/msgpack-erlang.git
synced 2024-11-06 00:35:24 +00:00
Anable jsx|jiffy
option
This commit is contained in:
parent
77608032d8
commit
67292fc884
@ -43,6 +43,7 @@
|
||||
|
||||
-type msgpack_list_options() :: [
|
||||
{format, jsx|jiffy} |
|
||||
jsx | jiffy |
|
||||
{allow_atom, none|pack} |
|
||||
{enable_str, boolean()} |
|
||||
{ext, {msgpack_ext_packer(),msgpack_ext_unpacker()}}
|
||||
|
@ -117,6 +117,14 @@ parse_options(Opt) -> parse_options(Opt, ?OPTION{original_list=Opt}).
|
||||
|
||||
%% @private
|
||||
parse_options([], Opt) -> Opt;
|
||||
parse_options([jsx|TL], Opt0) ->
|
||||
Opt = Opt0?OPTION{interface=jsx,
|
||||
map_unpack_fun=msgpack_unpacker:map_unpacker(jsx)},
|
||||
parse_options(TL, Opt);
|
||||
parse_options([jiffy|TL], Opt0) ->
|
||||
Opt = Opt0?OPTION{interface=jiffy,
|
||||
map_unpack_fun=msgpack_unpacker:map_unpacker(jiffy)},
|
||||
parse_options(TL, Opt);
|
||||
parse_options([{format,Type}|TL], Opt0) when Type =:= jsx; Type =:= jiffy ->
|
||||
Opt = Opt0?OPTION{interface=Type,
|
||||
map_unpack_fun=msgpack_unpacker:map_unpacker(Type)},
|
||||
|
Loading…
Reference in New Issue
Block a user