# `Localize.Utils.Helpers`
[🔗](https://github.com/elixir-localize/localize/blob/v0.39.0/lib/localize/utils/helpers.ex#L1)

General purpose helper functions for Localize.

Provides utility functions for checking empty data structures
and wrapping `:persistent_term` operations.

# `empty?`

Returns a boolean indicating if a data structure is semantically empty.

### Arguments

* `value` — the value to check. Supported types are lists, maps, and `nil`.

### Returns

* `true` if the value is an empty list, an empty map, or `nil`.

* `false` otherwise.

### Examples

    iex> Localize.Utils.Helpers.empty?([])
    true

    iex> Localize.Utils.Helpers.empty?(%{})
    true

    iex> Localize.Utils.Helpers.empty?(nil)
    true

    iex> Localize.Utils.Helpers.empty?([1, 2])
    false

    iex> Localize.Utils.Helpers.empty?(%{a: 1})
    false

# `existing_atom`

```elixir
@spec existing_atom(String.t()) :: atom() | nil
```

Converts a string to an existing atom, returning `nil` if the atom
does not already exist in the atom table.

This is the safe alternative to `String.to_existing_atom/1` that
avoids using `try/rescue` as control flow.

### Arguments

* `string` is a binary string.

### Returns

* The atom if it exists, or `nil` otherwise.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
