This commit is contained in:
Lukian 2023-06-20 15:28:07 +02:00
parent 68f4b60012
commit 41ae7ff4bd
1010 changed files with 38622 additions and 17071 deletions

View file

@ -27,21 +27,21 @@ function Mixin(...constructors) {
function MixedClass(...args) {
for (const constructor of constructors)
// @ts-ignore: potentially abstract class
util_1.copyProps(this, new constructor(...args));
(0, util_1.copyProps)(this, new constructor(...args));
if (initFunctionName !== null && typeof this[initFunctionName] === 'function')
this[initFunctionName].apply(this, args);
}
MixedClass.prototype = settings_1.settings.prototypeStrategy === 'copy'
? util_1.hardMixProtos(prototypes, MixedClass)
: proxy_1.softMixProtos(prototypes, MixedClass);
? (0, util_1.hardMixProtos)(prototypes, MixedClass)
: (0, proxy_1.softMixProtos)(prototypes, MixedClass);
Object.setPrototypeOf(MixedClass, settings_1.settings.staticsStrategy === 'copy'
? util_1.hardMixProtos(constructors, null, ['prototype'])
: proxy_1.proxyMix(constructors, Function.prototype));
? (0, util_1.hardMixProtos)(constructors, null, ['prototype'])
: (0, proxy_1.proxyMix)(constructors, Function.prototype));
let DecoratedMixedClass = MixedClass;
if (settings_1.settings.decoratorInheritance !== 'none') {
const classDecorators = settings_1.settings.decoratorInheritance === 'deep'
? decorator_1.deepDecoratorSearch(...constructors)
: decorator_1.directDecoratorSearch(...constructors);
? (0, decorator_1.deepDecoratorSearch)(...constructors)
: (0, decorator_1.directDecoratorSearch)(...constructors);
for (let decorator of (_a = classDecorators === null || classDecorators === void 0 ? void 0 : classDecorators.class) !== null && _a !== void 0 ? _a : []) {
const result = decorator(DecoratedMixedClass);
if (result) {
@ -51,7 +51,7 @@ function Mixin(...constructors) {
applyPropAndMethodDecorators((_b = classDecorators === null || classDecorators === void 0 ? void 0 : classDecorators.static) !== null && _b !== void 0 ? _b : {}, DecoratedMixedClass);
applyPropAndMethodDecorators((_c = classDecorators === null || classDecorators === void 0 ? void 0 : classDecorators.instance) !== null && _c !== void 0 ? _c : {}, DecoratedMixedClass.prototype);
}
mixin_tracking_1.registerMixins(DecoratedMixedClass, constructors);
(0, mixin_tracking_1.registerMixins)(DecoratedMixedClass, constructors);
return DecoratedMixedClass;
}
exports.Mixin = Mixin;