mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-10 19:07:49 +00:00
Ensure _.isArray fallback returns a boolean value.
Former-commit-id: c96fb8e95c40d546099796f8337db6d4d3d33aea
This commit is contained in:
8
dist/lodash.js
vendored
8
dist/lodash.js
vendored
@@ -634,7 +634,9 @@
|
||||
* _.isArray([1, 2, 3]);
|
||||
* // => true
|
||||
*/
|
||||
var isArray = nativeIsArray;
|
||||
var isArray = nativeIsArray || function(value) {
|
||||
return value ? (typeof value == 'object' && toString.call(value) == arrayClass) : false;
|
||||
};
|
||||
|
||||
/**
|
||||
* A fallback implementation of `Object.keys` which produces an array of the
|
||||
@@ -1197,7 +1199,7 @@
|
||||
* // => true
|
||||
*/
|
||||
function isDate(value) {
|
||||
return value ? typeof value == 'object' && toString.call(value) == dateClass : false;
|
||||
return value ? (typeof value == 'object' && toString.call(value) == dateClass) : false;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1644,7 +1646,7 @@
|
||||
* // => true
|
||||
*/
|
||||
function isRegExp(value) {
|
||||
return value ? typeof value == 'object' && toString.call(value) == regexpClass : false;
|
||||
return value ? (typeof value == 'object' && toString.call(value) == regexpClass) : false;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user