Qx (qx v0.2.0)

View Source

Qx is a small collection of utilities and helpers for everyday Elixir work.

The functions live in focused modules:

  • Qx.String - presence checks, slugs and truncation
  • Qx.Map - deep merging, key conversion and pruning
  • Qx.Result - pipelines over {:ok, value} / {:error, reason} tuples

The most frequently reached-for helpers are also delegated here so that a single alias Qx is often enough:

iex> Qx.slugify("Hello, World!")
"hello-world"

iex> Qx.deep_merge(%{a: %{b: 1}}, %{a: %{c: 2}})
%{a: %{b: 1, c: 2}}

Summary

Functions

atomize_keys(term)

See Qx.Map.atomize_keys/1.

blank?(string)

See Qx.String.blank?/1.

compact(map)

See Qx.Map.compact/1.

compact(map, opts)

See Qx.Map.compact/2.

deep_merge(left, right)

See Qx.Map.deep_merge/2.

present?(string)

See Qx.String.present?/1.

slugify(string)

See Qx.String.slugify/1.

slugify(string, opts)

See Qx.String.slugify/2.

stringify_keys(term)

See Qx.Map.stringify_keys/1.

truncate(string, max)

See Qx.String.truncate/2.

truncate(string, max, opts)

See Qx.String.truncate/3.