2016-01-28 01:16:24 -08:00
|
|
|
define(['./_baseIndexOf'], function(baseIndexOf) {
|
2015-12-16 17:53:20 -08:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* A specialized version of `_.includes` for arrays without support for
|
|
|
|
|
* specifying an index to search from.
|
|
|
|
|
*
|
|
|
|
|
* @private
|
2016-08-11 23:27:31 -07:00
|
|
|
* @param {Array} [array] The array to inspect.
|
2015-12-16 17:53:20 -08:00
|
|
|
* @param {*} target The value to search for.
|
|
|
|
|
* @returns {boolean} Returns `true` if `target` is found, else `false`.
|
|
|
|
|
*/
|
|
|
|
|
function arrayIncludes(array, value) {
|
2016-10-30 20:06:57 -07:00
|
|
|
var length = array == null ? 0 : array.length;
|
2016-05-21 00:48:34 -07:00
|
|
|
return !!length && baseIndexOf(array, value, 0) > -1;
|
2015-12-16 17:53:20 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return arrayIncludes;
|
|
|
|
|
});
|