Skip to content

Commit

Permalink
Update escape option to be more consistent in naming
Browse files Browse the repository at this point in the history
  • Loading branch information
michalmuskala committed Jan 26, 2018
1 parent 543d557 commit f42dcbd
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion lib/encode.ex
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,12 @@ defmodule Jason.Encode do
defp escape_function(%{escape: escape}) do
case escape do
:json -> &escape_json/4
:unicode -> &escape_unicode/4
:html_safe -> &escape_html/4
:unicode_safe -> &escape_unicode/4
:javascript_safe -> &escape_javascript/4
# Keep for compatibility with Poison
:javascript -> &escape_javascript/4
:unicode -> &escape_unicode/4
end
end

Expand Down
2 changes: 1 addition & 1 deletion lib/jason.ex
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ defmodule Jason do
A blazing fast JSON parser and generator in pure Elixir.
"""

@type escape :: :json | :unicode | :html | :javascript
@type escape :: :json | :unicode_safe | :html_safe | :javascript_safe
@type maps :: :naive | :strict

@type encode_opt :: {:escape, escape} | {:maps, maps}
Expand Down

0 comments on commit f42dcbd

Please sign in to comment.