COLLECTED BY
Organization:
Internet Archive
Focused crawls are collections of frequently-updated webcrawl data from narrow (as opposed to broad or wide) web crawls, often focused on a single domain or subdomain.
The Wayback Machine - https://web.archive.org/web/20201220221445/https://github.com/lodash/lodash/blob/master/isNative.js
Permalink
Cannot retrieve contributors at this time
36 lines (32 sloc)
894 Bytes
import isObject from './isObject.js'
/**
* Used to match `RegExp`
* [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
*/
const reRegExpChar = /[ \\ ^$.*+?()[\] {}|] /g
/** Used to detect if a method is native. */
const reIsNative = RegExp ( `^${
Function . prototype . toString . call ( Object . prototype . hasOwnProperty )
. replace ( reRegExpChar , '\\$&' )
. replace ( /hasOwnProperty| ( function) .* ?(? = \\ \( ) | for .+ ?(? = \\ \] ) /g , '$1.*?' )
} $`)
/**
* Checks if `value` is a pristine native function.
*
* @since 3.0.0
* @category Lang
* @param {* } value The value to check.
* @returns {boolean } Returns `true` if `value` is a native function,
* else `false`.
* @example
*
* isNative(Array.prototype.push)
* // => true
*
* isNative(isDate)
* // => false
*/
function isNative ( value ) {
return isObject ( value ) && reIsNative . test ( value )
}
export default isNative
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session.
You signed out in another tab or window. Reload to refresh your session.