mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-07 01:57:50 +00:00
Bump to v3.10.0.
This commit is contained in:
@@ -1,7 +1,4 @@
|
||||
define(['../string/escapeRegExp', '../internal/isObjectLike'], function(escapeRegExp, isObjectLike) {
|
||||
|
||||
/** `Object#toString` result references. */
|
||||
var funcTag = '[object Function]';
|
||||
define(['./isFunction', '../internal/isObjectLike'], function(isFunction, isObjectLike) {
|
||||
|
||||
/** Used to detect host constructors (Safari > 5). */
|
||||
var reIsHostCtor = /^\[object .+?Constructor\]$/;
|
||||
@@ -15,15 +12,9 @@ define(['../string/escapeRegExp', '../internal/isObjectLike'], function(escapeRe
|
||||
/** Used to check objects for own properties. */
|
||||
var hasOwnProperty = objectProto.hasOwnProperty;
|
||||
|
||||
/**
|
||||
* Used to resolve the [`toStringTag`](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-object.prototype.tostring)
|
||||
* of values.
|
||||
*/
|
||||
var objToString = objectProto.toString;
|
||||
|
||||
/** Used to detect if a method is native. */
|
||||
var reIsNative = RegExp('^' +
|
||||
escapeRegExp(fnToString.call(hasOwnProperty))
|
||||
fnToString.call(hasOwnProperty).replace(/[\\^$.*+?()[\]{}|]/g, '\\$&')
|
||||
.replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
|
||||
);
|
||||
|
||||
@@ -47,7 +38,7 @@ define(['../string/escapeRegExp', '../internal/isObjectLike'], function(escapeRe
|
||||
if (value == null) {
|
||||
return false;
|
||||
}
|
||||
if (objToString.call(value) == funcTag) {
|
||||
if (isFunction(value)) {
|
||||
return reIsNative.test(fnToString.call(value));
|
||||
}
|
||||
return isObjectLike(value) && reIsHostCtor.test(value);
|
||||
|
||||
Reference in New Issue
Block a user