inversify
Version:
A powerful and lightweight inversion of control container for JavaScript and Node.js apps powered by TypeScript.
14 lines (13 loc) • 521 B
JavaScript
import { Metadata } from '../planning/metadata';
function propertyEventDecorator(eventKey, errorMessage) {
return function () {
return function (target, propertyKey) {
var metadata = new Metadata(eventKey, propertyKey);
if (Reflect.hasOwnMetadata(eventKey, target.constructor)) {
throw new Error(errorMessage);
}
Reflect.defineMetadata(eventKey, metadata, target.constructor);
};
};
}
export { propertyEventDecorator };