fix specs for to_term/x, thanks to michael truog

This commit is contained in:
alisdair sullivan 2012-03-25 13:18:26 -07:00
parent 91dcb65e3c
commit b57750fcfc
2 changed files with 11 additions and 7 deletions

View file

@ -33,9 +33,16 @@
-type opts() :: list().
-type json_value() :: list({binary(), json_value()})
| list(json_value())
| true
| false
| null
| integer()
| float()
| binary().
-spec to_term(Source::(binary() | list()), Opts::opts()) ->
list({binary(), any()}).
-spec to_term(Source::binary(), Opts::opts()) -> json_value().
to_term(Source, Opts) when is_list(Opts) ->
(jsx:decoder(?MODULE, Opts, jsx_utils:extract_opts(Opts)))(Source).