func v0.4.1 Func.Presence
Summary
Functions
The opposite of present?
Checks the value is empty
The opposite of empty?
It returns the itself when the value is present, or returns nil
Checks the value is present
Functions
The opposite of present?
iex> Func.Presence.blank?(nil)
true
iex> Func.Presence.blank?(false)
true
iex> Func.Presence.blank?("")
true
iex> Func.Presence.blank?(%{})
true
iex> Func.Presence.blank?([])
true
iex> Func.Presence.blank?(1)
false
Checks the value is empty.
iex> Func.Presence.empty?([])
true
iex> Func.Presence.empty?(%{})
true
iex> Func.Presence.empty?("")
true
iex> Func.Presence.empty?(1)
false
The opposite of empty?
iex> Func.Presence.non_empty?([])
false
iex> Func.Presence.non_empty?(%{})
false
iex> Func.Presence.non_empty?("")
false
iex> Func.Presence.non_empty?(1)
true
It returns the itself when the value is present, or returns nil.
iex> Func.Presence.presence(nil)
nil
iex> Func.Presence.presence(false)
nil
iex> Func.Presence.presence("")
nil
iex> Func.Presence.presence(%{})
nil
iex> Func.Presence.presence([])
nil
iex> Func.Presence.presence(1)
1
Checks the value is present.
iex> Func.Presence.present?(nil)
false
iex> Func.Presence.present?(false)
false
iex> Func.Presence.present?("")
false
iex> Func.Presence.present?(%{})
false
iex> Func.Presence.present?([])
false
iex> Func.Presence.present?(1)
true