add maps_support/0
function that reports whether jsx
was
compiled with maps support or not
This commit is contained in:
parent
bbf7d39e85
commit
6b333396a3
2 changed files with 22 additions and 0 deletions
10
src/jsx.erl
10
src/jsx.erl
|
@ -28,6 +28,7 @@
|
|||
-export([format/1, format/2, minify/1, prettify/1]).
|
||||
-export([encoder/3, decoder/3, parser/3]).
|
||||
-export([resume/3]).
|
||||
-export([maps_support/0]).
|
||||
|
||||
-export_type([json_term/0, json_text/0, token/0]).
|
||||
-export_type([encoder/0, decoder/0, parser/0, internal_state/0]).
|
||||
|
@ -161,6 +162,15 @@ resume(Term, {parser, State, Handler, Stack}, Config) ->
|
|||
jsx_parser:resume(Term, State, Handler, Stack, jsx_config:parse_config(Config)).
|
||||
|
||||
|
||||
-spec maps_support() -> true | false.
|
||||
|
||||
-ifndef(maps_support).
|
||||
maps_support() -> false.
|
||||
-endif.
|
||||
-ifdef(maps_support).
|
||||
maps_support() -> true.
|
||||
-endif.
|
||||
|
||||
|
||||
-ifdef(TEST).
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue