mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-01-29 06:27:49 +00:00
Update vendor/underscore.
Former-commit-id: 9a00fa6c531e8cf0990526b7034cbde67ef335b3
This commit is contained in:
2
vendor/underscore/underscore-min.js
vendored
2
vendor/underscore/underscore-min.js
vendored
File diff suppressed because one or more lines are too long
16
vendor/underscore/underscore.js
vendored
16
vendor/underscore/underscore.js
vendored
@@ -938,8 +938,8 @@
|
||||
return obj === Object(obj);
|
||||
};
|
||||
|
||||
// Add some isType methods: isArguments, isString, isNumber, isDate, isRegExp.
|
||||
each(['Arguments', 'String', 'Number', 'Date', 'RegExp'], function(name) {
|
||||
// Add some isType methods: isArguments, isFunction, isString, isNumber, isDate, isRegExp.
|
||||
each(['Arguments', 'Function', 'String', 'Number', 'Date', 'RegExp'], function(name) {
|
||||
_['is' + name] = function(obj) {
|
||||
return toString.call(obj) == '[object ' + name + ']';
|
||||
};
|
||||
@@ -953,16 +953,10 @@
|
||||
};
|
||||
}
|
||||
|
||||
// Is a given variable a function?
|
||||
_.isFunction = function(obj) {
|
||||
return typeof obj === 'function';
|
||||
};
|
||||
|
||||
// Define a fallback for older versions of Chrome, Firefox, and Safari, where
|
||||
// a regexp is `typeof` "function".
|
||||
if (_.isFunction(/./)) {
|
||||
// Optimize `isFunction` if appropriate.
|
||||
if (typeof (/./) !== 'function') {
|
||||
_.isFunction = function(obj) {
|
||||
return toString.call(obj) == '[object Function]';
|
||||
return typeof obj === 'function';
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user