Files
NapCatQQ/.pnpm-store/v3/files/9c/667565b9cfc70d151d3e80459a5f6bf7fe01ccdf60bbc048ed6ead4d5e1d788ab51f79b9bd7f41505ea7ce0bc29f5dbcc63fe332ed2cc7113db7204e1352e2
T
TanTan e311ca3275
Build NapCat Artifacts / Type Check & Test (push) Waiting to run
docs: 仓库链接指向本镜像仓库
2026-11-13 09:25:58 +08:00

35 lines
1.9 KiB
Plaintext

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.resolveBindingDeactivations = resolveBindingDeactivations;
const common_1 = require("@inversifyjs/common");
const resolveBindingPreDestroy_1 = require("./resolveBindingPreDestroy");
const resolveBindingServiceDeactivations_1 = require("./resolveBindingServiceDeactivations");
const CACHE_KEY_TYPE = 'cache';
function resolveBindingDeactivations(params, binding) {
const preDestroyResult = (0, resolveBindingPreDestroy_1.resolveBindingPreDestroy)(params, binding);
if (preDestroyResult === undefined) {
return resolveBindingDeactivationsAfterPreDestroy(params, binding);
}
return preDestroyResult.then(() => resolveBindingDeactivationsAfterPreDestroy(params, binding));
}
function resolveBindingDeactivationsAfterPreDestroy(params, binding) {
const bindingCache = binding.cache;
if ((0, common_1.isPromise)(bindingCache.value)) {
return bindingCache.value.then((resolvedValue) => resolveBindingDeactivationsAfterPreDestroyFromValue(params, binding, resolvedValue));
}
return resolveBindingDeactivationsAfterPreDestroyFromValue(params, binding, bindingCache.value);
}
function resolveBindingDeactivationsAfterPreDestroyFromValue(params, binding, resolvedValue) {
let deactivationResult = undefined;
if (binding.onDeactivation !== undefined) {
const bindingDeactivation = binding.onDeactivation;
deactivationResult = bindingDeactivation(resolvedValue);
}
if (deactivationResult === undefined) {
return (0, resolveBindingServiceDeactivations_1.resolveBindingServiceDeactivations)(params, binding.serviceIdentifier, resolvedValue);
}
else {
return deactivationResult.then(() => (0, resolveBindingServiceDeactivations_1.resolveBindingServiceDeactivations)(params, binding.serviceIdentifier, resolvedValue));
}
}
//# sourceMappingURL=resolveBindingDeactivations.js.map