chai-latte
Version:
Build expressive & readable fluent interface libraries.
20 lines • 518 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.getPrototypeChain = void 0;
const getPrototypeChain = (obj) => {
const chain = [];
let t = obj;
while (t) {
t = Object.getPrototypeOf(t);
if (t === null) {
break;
}
if (t.constructor) {
chain.push(t.constructor);
}
chain.push(t);
}
return chain;
};
exports.getPrototypeChain = getPrototypeChain;
//# sourceMappingURL=getPrototypeChain.js.map