altstd v0.1.0 Altstd View Source

Altstd

Lodash, implemented for Elixir.

Hex Version Docs Hex downloads GitHub MIT License


Installation

The package is available in Hex, it can be installed by adding :altstd to your list of dependencies in mix.exs:

def deps do
  [
    {:altstd, "~> 0.1.0"}
  ]
end

Packages

NameModuleDescriptionVersion
altstd_compactAltstd.CompactRemoves all falsey values in the given object, recursively.Hex VersionDocs

Link to this section Summary

Functions

Creates an array with all falsey values removed.

Link to this section Functions

Link to this function

compact(object, opts \\ [])

View Source (since 0.1.0)
compact(any(), keyword()) :: [any()]

Creates an array with all falsey values removed.

Examples

iex> Altstd.compact(1)
[1]

iex> Altstd.compact(nil)
[]

iex> Altstd.compact([0, 1, 2, 3, false])
[1, 2, 3]

See: Altstd.Compact