is_x v0.1.0 IsX

          ___    __  __     __  __           _       _
         |_ _|___\ \/ /    |  \/  | ___   __| |_   _| | ___
          | |/ __|\  /     | |\/| |/ _ \ / _` | | | | |/ _ \
          | |\__ \/  \     | |  | | (_) | (_| | |_| | |  __/
         |___|___/_/\_\    |_|  |_|\___/ \__,_|\__,_|_|\___|

This module comprises of truth value definitions like the whether the data is empty or blank or null or nil or its length is 0 like.

To say in one word the extended functions of value assertion functions

Summary

Functions

Checks for the blank Strings Spaces are treated as blank here

Checks the given data is empty or not . Spaces,new_lines,tabs treated as binary here

Returns true if the given data is not a number or else returns false

Checks given number is negative or not

Here except the nil and Null rest are treated as data present empty maps,tuples and lists are treated as the data

Checks given number is positive or not

Here except the nil and Null ,data is true Even the false and true also treated as data

Checks whether the passed value is zero or not

Functions

is_blank()
is_blank(data)

Specs

is_blank(term) :: boolean

Checks for the blank Strings Spaces are treated as blank here

Examples

iex> IsX.is_blank(Null)
true
iex> IsX.is_blank(nil)
true
iex> IsX.is_blank("")
true
iex> IsX.is_blank(" ")
true
iex> IsX.is_blank([])
true
iex> IsX.is_blank({})
true
iex> IsX.is_blank("\n\t")
true
iex> IsX.is_blank(%{})
true
iex> IsX.is_blank()
true
iex> IsX.is_blank([1,2,3])
false
iex> IsX.is_blank(%{name: "blackode"})
false
iex> IsX.is_blank(12345)
false
iex> IsX.is_blank("blackode")
false
is_empty()
is_empty(data)

Specs

is_empty(term) :: boolean

Checks the given data is empty or not . Spaces,new_lines,tabs treated as binary here

Examples

iex> IsX.is_empty(Null)
true
iex> IsX.is_empty(nil)
true
iex> IsX.is_empty("")
true
iex> IsX.is_empty([])
true
iex> IsX.is_empty(%{})
true
iex> IsX.is_empty()
true
iex> IsX.is_empty([1,2,3])
false
iex> IsX.is_empty(%{name: "blackode"})
false
iex> IsX.is_empty("blackode")
false
iex> IsX.is_empty(12345)
false
iex> IsX.is_empty(" ")
false
iex> IsX.is_empty("\n\t")
false
is_nan(data)

Specs

is_nan(term) :: boolean

Returns true if the given data is not a number or else returns false

Examples

iex> IsX.is_nan("blackode 1234")
true
iex> IsX.is_nan("1234")
true
iex> IsX.is_nan(1234)
false
is_negative(num)

Specs

is_negative(number) :: boolean

Checks given number is negative or not

Examples

iex> IsX.is_negative 0
false
iex> IsX.is_negative 7
false
iex> IsX.is_negative -7
true
is_none()
is_none(data)

Specs

is_none(term) :: boolean

Here except the nil and Null rest are treated as data present empty maps,tuples and lists are treated as the data

Examples

iex> IsX.is_none(Null)
true
iex> IsX.is_none(nil)
true
iex> IsX.is_none()
true
iex> IsX.is_none("")
false
iex> IsX.is_none(" ")
false
iex> IsX.is_none([])
false
iex> IsX.is_none({})
false
iex> IsX.is_none("\n\t")
false
iex> IsX.is_none(%{})
false
iex> IsX.is_none([1,2,3])
false
iex> IsX.is_none(%{name: "blackode"})
false
is_positive(num)

Specs

is_positive(number) :: boolean

Checks given number is positive or not

Examples

iex> IsX.is_positive 0
true
iex> IsX.is_positive 7
true
iex> IsX.is_positive -7
false
is_present()

Here except the nil and Null ,data is true Even the false and true also treated as data

Examples

iex> IsX.is_present(Null)
false
iex> IsX.is_present(nil)
false
iex> IsX.is_present()
false
iex> IsX.is_present("")
false
iex> IsX.is_present(" ")
false
iex> IsX.is_present([])
false
iex> IsX.is_present({})
false
iex> IsX.is_present("\n\t")
false
iex> IsX.is_present(%{})
false
iex> IsX.is_present(0)
true
iex> IsX.is_present([1,2,3])
true
iex> IsX.is_present(%{name: "blackode"})
true
iex> IsX.is_present(true)
true
iex> IsX.is_present(false)
true
iex> IsX.is_present(:false)
true
iex> IsX.is_present(:true)
true
is_present(data)

Specs

is_present(term) :: boolean
is_zero(data)

Specs

is_zero(term) :: boolean

Checks whether the passed value is zero or not

Examples

iex> IsX.is_zero 0
true
iex> IsX.is_zero(length([]))
tue
iex> IsX.is_zero("blackode")
false
iex> IsX.is_zero 1234
false
iex> IsX.is_zero 0.0
false