Skip to content

Commit

Permalink
string,atom encode methods with user_options
Browse files Browse the repository at this point in the history
  • Loading branch information
noizu committed Nov 27, 2023
1 parent 27080e2 commit 63b789d
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lib/encode.ex
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,9 @@ defmodule Jason.Encode do
def atom(atom, {escape, _encode_map}) do
encode_atom(atom, escape)
end
def atom(atom, {escape, _encode_map, _user_opts}) do
encode_atom(atom, escape)
end

defp encode_atom(nil, _escape), do: "null"
defp encode_atom(true, _escape), do: "true"
Expand Down Expand Up @@ -323,7 +326,9 @@ defmodule Jason.Encode do
def string(string, {escape, _encode_map}) do
encode_string(string, escape)
end

def string(string, {escape, _encode_map,_user_opts}) do
encode_string(string, escape)
end
defp encode_string(string, escape) do
[?", escape.(string), ?"]
end
Expand Down

0 comments on commit 63b789d

Please sign in to comment.