index.js 1.1 KB

12345678910111213141516171819202122232425262728293031323334
  1. /**
  2. * Lo-Dash 2.4.1 (Custom Build) <http://lodash.com/>
  3. * Build: `lodash modularize modern exports="npm" -o ./npm/`
  4. * Copyright 2012-2013 The Dojo Foundation <http://dojofoundation.org/>
  5. * Based on Underscore.js 1.5.2 <http://underscorejs.org/LICENSE>
  6. * Copyright 2009-2013 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
  7. * Available under MIT license <http://lodash.com/license>
  8. */
  9. /** Used for native method references */
  10. var objectProto = Object.prototype;
  11. /** Used to resolve the internal [[Class]] of values */
  12. var toString = objectProto.toString;
  13. /** Used to detect if a method is native */
  14. var reNative = RegExp('^' +
  15. String(toString)
  16. .replace(/[.*+?^${}()|[\]\\]/g, '\\$&')
  17. .replace(/toString| for [^\]]+/g, '.*?') + '$'
  18. );
  19. /**
  20. * Checks if `value` is a native function.
  21. *
  22. * @private
  23. * @param {*} value The value to check.
  24. * @returns {boolean} Returns `true` if the `value` is a native function, else `false`.
  25. */
  26. function isNative(value) {
  27. return typeof value == 'function' && reNative.test(value);
  28. }
  29. module.exports = isNative;