Skip to content

Commit 5636655

Browse files
committed
Add json_polyfill when required
1 parent a086f78 commit 5636655

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

mix.exs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,15 @@ defmodule Image.OCR.MixProject do
4040
{:elixir_make, "~> 0.8", runtime: false},
4141
{:ex_doc, "~> 0.34", only: :dev, runtime: false},
4242
{:dialyxir, "~> 1.4", only: [:dev, :test], runtime: false}
43-
]
43+
] ++ maybe_json_polyfill()
44+
end
45+
46+
defp maybe_json_polyfill do
47+
if Code.ensure_loaded?(:json) do
48+
[]
49+
else
50+
[{:json_polyfill, "~> 0.2 or ~> 1.0"}]
51+
end
4452
end
4553

4654
defp description do

0 commit comments

Comments
 (0)