@tsdi/pack
Version:
@tsdi/pack is simple build tasks, base on AOP, Ioc container, via @tsdi. dev build pack activities.
36 lines (34 loc) • 1.23 kB
JavaScript
var NodeActivityContext_1;
import { __decorate } from "tslib";
import { Injectable, Refs } from '@tsdi/ioc';
import { BuildContext } from '@tsdi/boot';
import { ActivityContext, Activity } from '@tsdi/activities';
import { PlatformServiceToken } from './IPlatformService';
/**
* pipe activity context.
*
* @export
* @class NodeActivityContext
* @extends {ActivityContext}
* @implements {IActivityContext<ITransform>}
*/
let NodeActivityContext = NodeActivityContext_1 = class NodeActivityContext extends ActivityContext {
get platform() {
var _a;
return (_a = this.context.getValue(PlatformServiceToken)) !== null && _a !== void 0 ? _a : this.getPlatform();
}
getPlatform() {
let pf = this.injector.getInstance(PlatformServiceToken, { provide: NodeActivityContext_1, useValue: this });
pf && this.setValue(PlatformServiceToken, pf);
return pf;
}
static ρAnn() {
return { "name": "NodeActivityContext", "params": {} };
}
};
NodeActivityContext = NodeActivityContext_1 = __decorate([
Injectable,
Refs(Activity, BuildContext)
], NodeActivityContext);
export { NodeActivityContext };
//# sourceMappingURL=sourcemaps/NodeActivityContext.js.map