Skip to content

Commit 67292fc

Browse files
author
Yuki Ito
committed
Anable jsx|jiffy option
1 parent 7760803 commit 67292fc

2 files changed

Lines changed: 9 additions & 0 deletions

File tree

include/msgpack.hrl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@
4343

4444
-type msgpack_list_options() :: [
4545
{format, jsx|jiffy} |
46+
jsx | jiffy |
4647
{allow_atom, none|pack} |
4748
{enable_str, boolean()} |
4849
{ext, {msgpack_ext_packer(),msgpack_ext_unpacker()}}

src/msgpack.erl

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,14 @@ parse_options(Opt) -> parse_options(Opt, ?OPTION{original_list=Opt}).
117117

118118
%% @private
119119
parse_options([], Opt) -> Opt;
120+
parse_options([jsx|TL], Opt0) ->
121+
Opt = Opt0?OPTION{interface=jsx,
122+
map_unpack_fun=msgpack_unpacker:map_unpacker(jsx)},
123+
parse_options(TL, Opt);
124+
parse_options([jiffy|TL], Opt0) ->
125+
Opt = Opt0?OPTION{interface=jiffy,
126+
map_unpack_fun=msgpack_unpacker:map_unpacker(jiffy)},
127+
parse_options(TL, Opt);
120128
parse_options([{format,Type}|TL], Opt0) when Type =:= jsx; Type =:= jiffy ->
121129
Opt = Opt0?OPTION{interface=Type,
122130
map_unpack_fun=msgpack_unpacker:map_unpacker(Type)},

0 commit comments

Comments
 (0)