/** * @author [Tristan Valcke]{@link https://github.com/Itee} * @license [BSD-3-Clause]{@link https://opensource.org/licenses/BSD-3-Clause} * * @module sources/cores/arrays/isArray * @desc Export functions to validate if a value is an array or not * @example {@lang javascript} * * import { isArray } from 'itee-validators' * * if( isArray( value ) ) { * //... * } else { * //... * } * */ /** * Check if given data is an array * * @param data {*} The data to check against the array type * @returns {boolean} true if data is array, false otherwise */ export function isArray ( data ) { return Array.isArray( data ) } /** * Check if given data is not an array * * @param data {*} The data to check against the array type * @returns {boolean} true if data is not array, false otherwise */ export function isNotArray ( data ) { return !Array.isArray( data ) } // #if IS_REMOVE_ON_BUILD export function isArray_0 ( data ) { return data instanceof Array } export function isNotArray_0 ( data ) { return !isArray( data ) } // #endif