mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-02 08:07:50 +00:00
19 lines
479 B
JavaScript
19 lines
479 B
JavaScript
/** Used for built-in method references. */
|
|
const objectProto = Object.prototype
|
|
|
|
/**
|
|
* Checks if `value` is likely a prototype object.
|
|
*
|
|
* @private
|
|
* @param {*} value The value to check.
|
|
* @returns {boolean} Returns `true` if `value` is a prototype, else `false`.
|
|
*/
|
|
function isPrototype(value) {
|
|
const Ctor = value && value.constructor
|
|
const proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto
|
|
|
|
return value === proto
|
|
}
|
|
|
|
export default isPrototype
|