7 lines
252 B
JavaScript
7 lines
252 B
JavaScript
export function mixinClasses(dest, ...sources) {
|
|
for (const source of sources) {
|
|
const properties = Object.getOwnPropertyDescriptors(source.prototype)
|
|
delete properties.constructor
|
|
Object.defineProperties(dest.prototype, properties)
|
|
}
|
|
} |