Fix -spec declaration to prevent dialyzer problems.

This commit is contained in:
Michael Truog 2012-03-25 00:26:12 -07:00
parent da88071cdd
commit d560d7ff3a
2 changed files with 9 additions and 5 deletions

View file

@ -60,8 +60,11 @@ format(Source) -> format(Source, []).
format(Source, Opts) -> jsx_to_json:format(Source, Opts).
-spec to_term(Source::binary()) -> any().
-spec to_term(Source::binary(), Opts::jsx_to_term:opts()) -> any().
-spec to_term(Source::binary()) ->
list({binary(), any()}).
-spec to_term(Source::binary(), Opts::jsx_to_term:opts()) ->
list({binary(), any()}).
to_term(Source) -> to_term(Source, []).

View file

@ -34,7 +34,8 @@
-type opts() :: list().
-spec to_term(Source::(binary() | list()), Opts::opts()) -> binary().
-spec to_term(Source::(binary() | list()), Opts::opts()) ->
list({binary(), any()}).
to_term(Source, Opts) when is_list(Opts) ->
(jsx:decoder(?MODULE, Opts, jsx_utils:extract_opts(Opts)))(Source).