UNPKG

1-liners

Version:

Useful oneliners and shorthand functions

31 lines (27 loc) 580 B
/** * @module 1-liners/isPrototypeOf * * @description * * Check if an object's prototype exists in another object's prototype chain * * @example * * function Foo(){}; * function Bar(){}; * * Bar.prototype = new Foo(); * * const foo = new Foo(); * const bar = new Bar(); * * Foo.prototype.isPrototypeOf(bar); // => true * Bar.prototype.isPrototypeOf(foo); // => false * */ "use strict"; exports.__esModule = true; exports["default"] = function (prototypeObj, obj) { return prototypeObj.prototype.isPrototypeOf(obj); }; module.exports = exports["default"];