mirror of
https://gitee.com/nocobase/nocobase.git
synced 2025-05-06 14:09:25 +08:00
12 lines
368 B
TypeScript
12 lines
368 B
TypeScript
export function applyMixins(derivedCtor: any, constructors: any[]) {
|
|
constructors.forEach((baseCtor) => {
|
|
Object.getOwnPropertyNames(baseCtor.prototype).forEach((name) => {
|
|
Object.defineProperty(
|
|
derivedCtor.prototype,
|
|
name,
|
|
Object.getOwnPropertyDescriptor(baseCtor.prototype, name) || Object.create(null),
|
|
);
|
|
});
|
|
});
|
|
}
|