mirror of
https://github.com/Mintplex-Labs/anything-llm.git
synced 2024-11-14 18:40:11 +01:00
17 lines
405 B
JavaScript
17 lines
405 B
JavaScript
|
function InheritMultiple(bases = []) {
|
||
|
class Bases {
|
||
|
constructor() {
|
||
|
bases.forEach((base) => Object.assign(this, new base()));
|
||
|
}
|
||
|
}
|
||
|
|
||
|
bases.forEach((base) => {
|
||
|
Object.getOwnPropertyNames(base.prototype)
|
||
|
.filter((prop) => prop != "constructor")
|
||
|
.forEach((prop) => (Bases.prototype[prop] = base.prototype[prop]));
|
||
|
});
|
||
|
return Bases;
|
||
|
}
|
||
|
|
||
|
module.exports = InheritMultiple;
|