Simplify isType modules.

This commit is contained in:
John-David Dalton
2017-01-10 13:44:02 -08:00
parent b2f69ea36a
commit 4ecd69e4fa
24 changed files with 50 additions and 217 deletions

View File

@@ -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.*?')
}$`);