mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-03 00:27:50 +00:00
Simplify isType modules.
This commit is contained in:
@@ -11,15 +11,9 @@ const reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
|
||||
/** Used to detect host constructors (Safari). */
|
||||
const reIsHostCtor = /^\[object .+?Constructor\]$/;
|
||||
|
||||
/** Used to resolve the decompiled source of functions. */
|
||||
const funcToString = Function.prototype.toString;
|
||||
|
||||
/** Used to check objects for own properties. */
|
||||
const hasOwnProperty = Object.prototype.hasOwnProperty;
|
||||
|
||||
/** Used to detect if a method is native. */
|
||||
const reIsNative = RegExp(`^${
|
||||
funcToString.call(hasOwnProperty)
|
||||
Function.prototype.toString.call(Object.prototype.hasOwnProperty)
|
||||
.replace(reRegExpChar, '\\$&')
|
||||
.replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?')
|
||||
}$`);
|
||||
|
||||
Reference in New Issue
Block a user