Skip to content

Commit

Permalink
Support to_timeout and is_non_struct_map
Browse files Browse the repository at this point in the history
  • Loading branch information
sabiwara committed May 25, 2024
1 parent 357c79d commit ccc78b3
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@

### Enhancements

- `Dune.Allowlist.Default` allows the new `Duration` module
- `Dune.Allowlist.Default` allows the new `Duration` module and new kernel
functions
- Add an `:inspect_sort_maps` option for deterministic outputs

## v0.3.6 (2023-12-23)
Expand Down
10 changes: 9 additions & 1 deletion lib/dune/allowlist/default.ex
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,14 @@ defmodule Dune.Allowlist.Default do
update_in
]a

@kernel_allowed @kernel_operators ++
# TODO Remove when dropping support for Elixir 1.16
extra_kernel_functions =
if System.version() |> Version.compare("1.17.0-rc.0") != :lt,
do: [:to_timeout, :is_non_struct_map],
else: []

@kernel_allowed extra_kernel_functions ++
@kernel_operators ++
@kernel_guards ++ @kernel_macros ++ @kernel_sigils ++ @kernel_functions

@kernel_shims [
Expand Down Expand Up @@ -314,6 +321,7 @@ defmodule Dune.Allowlist.Default do
allow DateTime, :all
allow NaiveDateTime, :all

# TODO Remove when dropping support for Elixir 1.16
if System.version() |> Version.compare("1.17.0-rc.0") != :lt do
allow Duration, :all
end
Expand Down

0 comments on commit ccc78b3

Please sign in to comment.