diff --git a/src/jsx.erl b/src/jsx.erl index 34f110e..6e9dd7b 100644 --- a/src/jsx.erl +++ b/src/jsx.erl @@ -67,8 +67,8 @@ parser(OptsList) -> end. --spec term_to_json(JSON::json()) -> binary(). --spec term_to_json(JSON::json(), Opts::encoder_opts()) -> binary(). +-spec term_to_json(JSON::eep0018()) -> binary(). +-spec term_to_json(JSON::eep0018(), Opts::encoder_opts()) -> binary(). term_to_json(JSON) -> term_to_json(JSON, []). diff --git a/src/jsx_eep0018.erl b/src/jsx_eep0018.erl index cd9c280..b2f817c 100644 --- a/src/jsx_eep0018.erl +++ b/src/jsx_eep0018.erl @@ -34,7 +34,7 @@ --spec json_to_term(JSON::binary(), Opts::decoder_opts()) -> json(). +-spec json_to_term(JSON::binary(), Opts::decoder_opts()) -> eep0018(). json_to_term(JSON, Opts) -> P = jsx:parser(opts_to_jsx_opts(Opts)), @@ -49,7 +49,7 @@ json_to_term(JSON, Opts) -> %% erlang terms to jsx events is straightforward and the iterator can be faked with an %% anonymous function --spec term_to_json(JSON::json(), Opts::encoder_opts()) -> binary(). +-spec term_to_json(JSON::eep0018(), Opts::encoder_opts()) -> binary(). term_to_json(List, Opts) -> case proplists:get_value(strict, Opts, true) of