UNPKG

@tsdi/pack

Version:

@tsdi/pack is simple build tasks, base on AOP, Ioc container, via @tsdi. dev build pack activities.

49 lines (47 loc) 2.14 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.AnnotationActivity = void 0; var tslib_1 = require("tslib"); var annotations_1 = require("@tsdi/annotations"); var components_1 = require("@tsdi/components"); var activities_1 = require("@tsdi/activities"); var TransformActivity_1 = require("./TransformActivity"); var AnnotationActivity = /** @class */ (function (_super) { tslib_1.__extends(AnnotationActivity, _super); function AnnotationActivity() { return _super !== null && _super.apply(this, arguments) || this; } AnnotationActivity.prototype.execute = function (ctx) { return tslib_1.__awaiter(this, void 0, void 0, function () { var enable; return tslib_1.__generator(this, function (_a) { switch (_a.label) { case 0: return [4 /*yield*/, ctx.resolveExpression(this.annotation)]; case 1: enable = _a.sent(); if (!enable) return [3 /*break*/, 3]; return [4 /*yield*/, this.pipeStream(ctx, ctx.getData(), this.framework)]; case 2: return [2 /*return*/, _a.sent()]; case 3: return [2 /*return*/]; } }); }); }; AnnotationActivityAnn = function () { return { "name": "AnnotationActivity", "params": { "execute": ["ctx"] } }; }; tslib_1.__decorate([ components_1.Input('annotationFramework', annotations_1.classAnnotations), tslib_1.__metadata("design:type", Object) ], AnnotationActivity.prototype, "framework", void 0); tslib_1.__decorate([ components_1.Input(), tslib_1.__metadata("design:type", Object) ], AnnotationActivity.prototype, "annotation", void 0); AnnotationActivity = tslib_1.__decorate([ activities_1.Task('annotation') ], AnnotationActivity); return AnnotationActivity; }(TransformActivity_1.TransformActivity)); exports.AnnotationActivity = AnnotationActivity; //# sourceMappingURL=../sourcemaps/transforms/AnnotationActivity.js.map