UNPKG

@cashfarm/plow

Version:

Library for validating input data and parameters

23 lines 954 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const container_1 = require("./container"); const symbols_1 = require("./symbols"); exports.Projections = Symbol.for('cashfarm.plow.projections'); function Projection(...events) { // @todo Check if there is a method to handle each of the events and throw an error if none is found return (target) => { if (!target[symbols_1.Symbols.ProjectionEvents]) { container_1.container.bind(target).to(target); container_1.container.bind(exports.Projections).to(target); target[symbols_1.Symbols.ProjectionEvents] = events; } else { events.map(e => { if (target[symbols_1.Symbols.ProjectionEvents].indexOf(e) < 0) target[symbols_1.Symbols.ProjectionEvents].push(e); }); } }; } exports.Projection = Projection; //# sourceMappingURL=decorators.js.map