mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-10 10:57: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);
|
return obj === Object(obj);
|
||||||
};
|
};
|
||||||
|
|
||||||
// Add some isType methods: isArguments, isString, isNumber, isDate, isRegExp.
|
// Add some isType methods: isArguments, isFunction, isString, isNumber, isDate, isRegExp.
|
||||||
each(['Arguments', 'String', 'Number', 'Date', 'RegExp'], function(name) {
|
each(['Arguments', 'Function', 'String', 'Number', 'Date', 'RegExp'], function(name) {
|
||||||
_['is' + name] = function(obj) {
|
_['is' + name] = function(obj) {
|
||||||
return toString.call(obj) == '[object ' + name + ']';
|
return toString.call(obj) == '[object ' + name + ']';
|
||||||
};
|
};
|
||||||
@@ -953,16 +953,10 @@
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
// Is a given variable a function?
|
// Optimize `isFunction` if appropriate.
|
||||||
_.isFunction = function(obj) {
|
if (typeof (/./) !== 'function') {
|
||||||
return typeof obj === 'function';
|
|
||||||
};
|
|
||||||
|
|
||||||
// Define a fallback for older versions of Chrome, Firefox, and Safari, where
|
|
||||||
// a regexp is `typeof` "function".
|
|
||||||
if (_.isFunction(/./)) {
|
|
||||||
_.isFunction = function(obj) {
|
_.isFunction = function(obj) {
|
||||||
return toString.call(obj) == '[object Function]';
|
return typeof obj === 'function';
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user