Skip to main content
Modules

Checker

Checker

The Checker module is responsible for performing data checking actions. Its methods can be accessed as in the example below:

js
const checker = await Checker.contains["v1_0_0"]({
data: "Roberty",
value: "Roberty"
})

Methods

contains

Method responsible for checking whether a value is in a given type of data. This data can be strings, arrays, numbers and objects.

js
const checker = await Checker.contains["v1_0_0"]({
data: "Roberty",
value: "R"
})

Required parameters

  • data: String, Array, Number, Object - expects the data that will be checked.
  • value: String, Array, Number, Object - expects the value that will be searched for.

Optional parameters

This method has no optional parameters.

Return

The constant or variable created, such as the checker of the example shown earlier, receives a boolean value that is true if the value searched for is found in the data, or false if it is not found.

inBetween

Method responsible for checking whether a number is within a range of values.

js
const checker = await Checker.inBetween["v1_0_0"]({
data: 3,
min: 1,
max: 10,
})

Required parameters

  • data: Number - expects the number that will be checked.
  • min: Number - expects the minimum value of the interval.
  • max: Number - expects the maximum value of the interval.

Optional parameters

This method has no optional parameters.

Return

The constant or variable created, such as the checker of the example shown earlier, receives a boolean value that is true if the number is within the interval, or false if it is not.

isEmpty

Method responsible for checking whether a piece of data is empty.

js
const checker = await Checker.isEmpty["v1_0_0"]({
value: "",
})

Required parameters

  • value: String|Array|Number|Object|NaN|Null - expects the data that will be checked.

Optional parameters

This method has no optional parameters.

Return

The constant or variable created, such as the checker of the example shown earlier, receives a boolean value that is true if the data is empty, or false if it is not.

isNumber

Method responsible for checking whether a piece of data is a number.

js
const checker = await Checker.isNumber["v1_0_0"]({
value: 3,
})

Required parameters

  • value: Any - expects any value to be checked.

Optional parameters

This method has no optional parameters.

Return

The constant or variable created, such as the checker of the example shown earlier, receives a boolean value that is true if the data is a number, or false if it is not.

isString

Method responsible for checking whether a piece of data is a string.

js
const checker = await Checker.isString["v1_0_0"]({
value: "Roberty",
})

Required parameters

  • value: Any - expects any value to be checked.

Optional parameters

This method has no optional parameters.

Return

The constant or variable created, such as the checker of the example shown earlier, receives a boolean value that is true if the data is a string, or false if it is not.

notContains

Method responsible for checking whether a value is not contained in a given type of data. This data can be strings, arrays, numbers and objects.

js
const checker = await Checker.notContains["v1_0_0"]({
data: "Roberty",
value: "R"
})

Required parameters

  • data: String, Array, Number, Object - expects the data that will be checked.
  • value: String, Array, Number, Object - expects the value that will be searched for.

Optional parameters

This method has no optional parameters.

Return

The constant or variable created, such as the checker of the example shown earlier, receives a boolean value that is true if the value searched for is not found in the data, or false if it is found.