updated examples for new NEW api
This commit is contained in:
parent
ce503823c8
commit
012317e0c5
4 changed files with 56 additions and 4 deletions
|
@ -34,7 +34,7 @@
|
|||
|
||||
pretty(JSON, Opts) ->
|
||||
Init = init(parse_opts(Opts, #opts{})),
|
||||
P = jsx:decoder({{jsx_prettify, jsx_event}, Init}, []),
|
||||
P = jsx:decoder({jsx_prettify, jsx_event, Init}, []),
|
||||
case P(JSON) of
|
||||
{incomplete, _} -> {error, badjson}
|
||||
; {error, badjson} -> {error, badjson}
|
||||
|
@ -93,7 +93,7 @@ format(string, String) ->
|
|||
format(literal, Literal) ->
|
||||
erlang:atom_to_list(Literal);
|
||||
format(_, Number) ->
|
||||
Number;
|
||||
Number.
|
||||
|
||||
|
||||
indent(Indent, Level) ->
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue