UNPKG

@inversifyjs/core

Version:

InversifyJs core package

16 lines 863 B
import { updateOwnReflectMetadata } from '@inversifyjs/reflect-metadata-utils'; import { classMetadataReflectKey } from '../../reflectMetadata/data/classMetadataReflectKey.js'; import { updateMaybeClassMetadataPreDestroy } from '../actions/updateMaybeClassMetadataPreDestroy.js'; import { getDefaultClassMetadata } from '../calculations/getDefaultClassMetadata.js'; import { handleInjectionError } from '../calculations/handleInjectionError.js'; export function preDestroy() { return (target, propertyKey, _descriptor) => { try { updateOwnReflectMetadata(target.constructor, classMetadataReflectKey, getDefaultClassMetadata, updateMaybeClassMetadataPreDestroy(propertyKey)); } catch (error) { handleInjectionError(target, propertyKey, undefined, error); } }; } //# sourceMappingURL=preDestroy.js.map