anything-llm/server/utils/agents/aibitat/providers/helpers/classes.js

17 lines
405 B
JavaScript
Raw Normal View History

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;