Error messages

by Julien Etienne

JavaScript

/**
 * Checks if a value is an array.
 * @function
 * @param {*} value - The value to check.
 * @returns {boolean} Returns true if the value is an array, else false.
 */
const isArray = Array.isArray

/**
 * Checks if a value is a BigInt.
 * @function
 * @param {*} value - The value to check.
 * @returns {boolean} Returns true if the value is a BigInt, else false.
 */
const isBigInt = value => typeof value === 'bigint'

/**
 * Checks if a value is a boolean.
 * @function
 * @param {*} value - The value to check.
 * @returns {boolean} Returns true if the value is a boolean, else false.
 */
const isBoolean = value => typeof value === 'boolean'

/**
 * Checks if a value is a function.
 * @function
 * @param {*} value - The value to check.
 * @returns {boolean} Returns true if the value is a function, else false.
 */
const isFunction = value => typeof value === 'function'

/**
 * Checks if a value is an integer.
 * @function
 * @param {*} value - The value to check.
 * @returns {boolean} Returns true if the value is an integer, else false.
 */
const isInteger = value => Number.isInteger(value)

/**
 * Checks if a value is NaN (Not a Number).
 * @function
 * @param {*} value - The value to check.
 * @returns {boolean} Returns true if the value is NaN, else false.
 */
const isNaN = value => Number.isNaN(value)

/**
 * Checks if a value is numeric.
 * @function
 * @param {*} value - The value to check.
 * @returns {boolean} Returns true if the value is numeric, else false.
 */
const isNumeric = value => typeof value === 'number' && !Number.isNaN(value)

/**
 * Checks if a value is an object.
 * @function
 * @param {*} value - The value to check.
 * @returns {boolean} Returns true if the value is an object, else false.
 */
const isObject = value => value !== null && typeof value === 'object' && !Array.isArray(value)

/**
 * Checks if a value is a string.
 * @function
 * @param {*} value - The value to check.
 * @returns {boolean} Returns true if the value is a string,...