Build NapCat Artifacts / Windows Loader Test (push) Canceled after 0s
Build NapCat Artifacts / Type Check & Test (push) Canceled after 0s
Build NapCat Artifacts / Build NapCat.Framework (push) Canceled after 0s
Build NapCat Artifacts / Build NapCat.Shell (push) Canceled after 0s
20 lines
1.0 KiB
Plaintext
20 lines
1.0 KiB
Plaintext
"use strict";
|
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
exports.getExtendedLifecycle = getExtendedLifecycle;
|
|
function getLifecycleSetUnion(extend, baseSet, currentSet) {
|
|
if (extend) {
|
|
return new Set([...baseSet, ...currentSet]);
|
|
}
|
|
return currentSet;
|
|
}
|
|
function getExtendedLifecycle(options, baseTypeClassMetadata, typeMetadata) {
|
|
const extendPostConstructMethods = options.lifecycle?.extendPostConstructMethods ?? true;
|
|
const extendPreDestroyMethods = options.lifecycle?.extendPreDestroyMethods ?? true;
|
|
const preDestroyMethodNames = getLifecycleSetUnion(extendPreDestroyMethods, baseTypeClassMetadata.lifecycle.preDestroyMethodNames, typeMetadata.lifecycle.preDestroyMethodNames);
|
|
const postConstructMethodNames = getLifecycleSetUnion(extendPostConstructMethods, baseTypeClassMetadata.lifecycle.postConstructMethodNames, typeMetadata.lifecycle.postConstructMethodNames);
|
|
return {
|
|
postConstructMethodNames,
|
|
preDestroyMethodNames,
|
|
};
|
|
}
|
|
//# sourceMappingURL=getExtendedLifecycle.js.map |