Sha256: 1e99406998d0b3d47f6cd1b65d5d1a46dc339adef0d58cd15d98a6e795fcc040

Contents?: true

Size: 1.38 KB

Versions: 273

Compression:

Stored size: 1.38 KB

Contents

var isFunction = require('./isFunction'),
    isMasked = require('./_isMasked'),
    isObject = require('./isObject'),
    toSource = require('./_toSource');

/**
 * Used to match `RegExp`
 * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
 */
var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;

/** Used to detect host constructors (Safari). */
var reIsHostCtor = /^\[object .+?Constructor\]$/;

/** Used for built-in method references. */
var funcProto = Function.prototype,
    objectProto = Object.prototype;

/** Used to resolve the decompiled source of functions. */
var funcToString = funcProto.toString;

/** Used to check objects for own properties. */
var hasOwnProperty = objectProto.hasOwnProperty;

/** Used to detect if a method is native. */
var reIsNative = RegExp('^' +
  funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&')
  .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
);

/**
 * The base implementation of `_.isNative` without bad shim checks.
 *
 * @private
 * @param {*} value The value to check.
 * @returns {boolean} Returns `true` if `value` is a native function,
 *  else `false`.
 */
function baseIsNative(value) {
  if (!isObject(value) || isMasked(value)) {
    return false;
  }
  var pattern = isFunction(value) ? reIsNative : reIsHostCtor;
  return pattern.test(toSource(value));
}

module.exports = baseIsNative;

Version data entries

273 entries across 271 versions & 29 rubygems

Version Path
immosquare-cleaner-0.1.60 node_modules/lodash/_baseIsNative.js
immosquare-cleaner-0.1.59 node_modules/lodash/_baseIsNative.js
immosquare-cleaner-0.1.58 node_modules/lodash/_baseIsNative.js
immosquare-cleaner-0.1.57 node_modules/lodash/_baseIsNative.js
immosquare-cleaner-0.1.56 node_modules/lodash/_baseIsNative.js
immosquare-cleaner-0.1.55 node_modules/lodash/_baseIsNative.js
immosquare-cleaner-0.1.54 node_modules/lodash/_baseIsNative.js
immosquare-cleaner-0.1.53 node_modules/lodash/_baseIsNative.js
immosquare-cleaner-0.1.52 node_modules/lodash/_baseIsNative.js
trusty-cms-6.3.1 node_modules/lodash/_baseIsNative.js
immosquare-cleaner-0.1.51 node_modules/lodash/_baseIsNative.js
boring_generators-0.15.0 tmp/templates/app_template/node_modules/lodash/_baseIsNative.js
clapton-0.0.26 lib/clapton/javascripts/node_modules/lodash/_baseIsNative.js
clapton-0.0.25 lib/clapton/javascripts/node_modules/lodash/_baseIsNative.js
immosquare-cleaner-0.1.50 node_modules/lodash/_baseIsNative.js
clapton-0.0.24 lib/clapton/javascripts/node_modules/lodash/_baseIsNative.js
clapton-0.0.23 lib/clapton/javascripts/node_modules/lodash/_baseIsNative.js
clapton-0.0.22 lib/clapton/javascripts/node_modules/lodash/_baseIsNative.js
clapton-0.0.21 lib/clapton/javascripts/node_modules/lodash/_baseIsNative.js
clapton-0.0.20 lib/clapton/javascripts/node_modules/lodash/_baseIsNative.js