UNPKG

tsioc

Version:

tsioc is AOP, Ioc container, via typescript decorator

55 lines (53 loc) 2.88 kB
"use strict"; var __extends = (this && this.__extends) || (function () { var extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; var __metadata = (this && this.__metadata) || function (k, v) { if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); }; var __param = (this && this.__param) || function (paramIndex, decorator) { return function (target, key) { decorator(target, key, paramIndex); } }; Object.defineProperty(exports, "__esModule", { value: true }); var index_1 = require("../aop/index"); var index_2 = require("../core/index"); var index_3 = require("../utils/index"); var LoggerAspect_1 = require("./LoggerAspect"); var AnnotationLogerAspect = /** @class */ (function (_super) { __extends(AnnotationLogerAspect, _super); function AnnotationLogerAspect(container) { return _super.call(this, container) || this; } AnnotationLogerAspect.prototype.logging = function (joinPoint, annotation) { this.processLog(joinPoint, annotation); }; AnnotationLogerAspect.classAnnations = { "name": "AnnotationLogerAspect", "params": { "constructor": ["container"], "logging": ["joinPoint", "annotation"] } }; __decorate([ index_1.Pointcut('@annotation(Logger)', 'annotation'), __metadata("design:type", Function), __metadata("design:paramtypes", [index_1.Joinpoint, Array]), __metadata("design:returntype", void 0) ], AnnotationLogerAspect.prototype, "logging", null); AnnotationLogerAspect = __decorate([ index_2.Singleton, index_1.Aspect, __param(0, index_2.Inject(index_3.symbols.IContainer)), __metadata("design:paramtypes", [Object]) ], AnnotationLogerAspect); return AnnotationLogerAspect; }(LoggerAspect_1.LoggerAspect)); exports.AnnotationLogerAspect = AnnotationLogerAspect; //# sourceMappingURL=sourcemaps/AnnotationLogerAspect.js.map