mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-07 10:07:48 +00:00
avoiding isFunction in _.include
This commit is contained in:
@@ -172,7 +172,7 @@
|
|||||||
|
|
||||||
// Determine if a given value is included in the array or object using '==='.
|
// Determine if a given value is included in the array or object using '==='.
|
||||||
_.include = function(obj, target) {
|
_.include = function(obj, target) {
|
||||||
if (obj && _.isFunction(obj.indexOf)) return _.indexOf(obj, target) != -1;
|
if (obj && obj.indexOf === nativeIndexOf) return obj.indexOf(target) != -1;
|
||||||
return !! _.detect(obj, function(value) {
|
return !! _.detect(obj, function(value) {
|
||||||
return value === target;
|
return value === target;
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user