_isPrototype.js 480 B

123456789101112131415161718
  1. /** Used for built-in method references. */
  2. var objectProto = Object.prototype;
  3. /**
  4. * Checks if `value` is likely a prototype object.
  5. *
  6. * @private
  7. * @param {*} value The value to check.
  8. * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.
  9. */
  10. function isPrototype(value) {
  11. var Ctor = value && value.constructor,
  12. proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto;
  13. return value === proto;
  14. }
  15. module.exports = isPrototype;