@lenka/alchemist
Version:
Microlibrary for multiple inheritance
16 lines • 421 B
JavaScript
export function buildProtoChain(instance) {
const chain = [];
if (!['object', 'function'].includes(typeof instance)) {
return chain;
}
let prototype = instance;
while (prototype) {
prototype = Object.getPrototypeOf(prototype);
if (prototype) {
chain.push(prototype.constructor.name);
}
}
return chain;
}
;
//# sourceMappingURL=buildProtoChain.js.map