"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.updateMaybeClassMetadataPreDestroy = updateMaybeClassMetadataPreDestroy;
const InversifyCoreError_1 = require("../../error/models/InversifyCoreError");
const InversifyCoreErrorKind_1 = require("../../error/models/InversifyCoreErrorKind");
function updateMaybeClassMetadataPreDestroy(methodName) {
    return (metadata) => {
        if (metadata.lifecycle.preDestroyMethodNames.has(methodName)) {
            throw new InversifyCoreError_1.InversifyCoreError(InversifyCoreErrorKind_1.InversifyCoreErrorKind.injectionDecoratorConflict, `Unexpected duplicated preDestroy method ${methodName.toString()}`);
        }
        metadata.lifecycle.preDestroyMethodNames.add(methodName);
        return metadata;
    };
}
//# sourceMappingURL=updateMaybeClassMetadataPreDestroy.js.map