Mandrake v0.0.2 Mandrake.Type
Mandrake functions for types.
Summary
Functions
Returns the extension of the tuple with the second
Always return false
Always return true
Create a copy of a value
Returns true if value is not nil
Returns true if value is nil or false
Returns true if value is nil
Returns a function that split a string with the given pattern
Removes whitespace at the beginning and at the end of the string
Returns true if value is not nil or false
Returns type of value
Functions
Returns the extension of the tuple with the second.
Examples
iex> Mandrake.Type.assign({ "prop1", "prop2" }, { "prop3" })
{ "prop1", "prop2", "prop3" }
Create a copy of a value.
Examples
iex> Mandrake.Type.clone([1, 2, 3, 4, 5])
[1, 2, 3, 4, 5]
Returns true if value is not nil.
Examples
iex> Mandrake.Type.exists("Example")
true
iex> Mandrake.Type.exists(nil)
false
Returns true if value is nil or false.
Examples
iex> Mandrake.Type.falsy("Example")
false
iex> Mandrake.Type.falsy(nil)
true
Returns true if value is nil.
Examples
iex> Mandrake.Type.is_nil([])
false
iex> Mandrake.Type.is_nil(nil)
true
Returns a function that split a string with the given pattern.
Examples
iex> splitComma = Mandrake.Type.split(",")
...> splitComma.("a,b,c")
["a", "b", "c"]
Removes whitespace at the beginning and at the end of the string.
Examples
iex> Mandrake.Type.trim(" Example ")
"Example"
Returns true if value is not nil or false.
Examples
iex> Mandrake.Type.truthy("Example")
true
iex> Mandrake.Type.truthy(nil)
false