1 | "use strict";
|
2 | Object.defineProperty(exports, "__esModule", { value: true });
|
3 | class TaskHandler {
|
4 | constructor(decoratee, id) {
|
5 | this.decoratee = decoratee;
|
6 | this.id = id;
|
7 | }
|
8 | selector(node) {
|
9 | return this.decoratee.selector(node);
|
10 | }
|
11 | async run(node, api) {
|
12 | try {
|
13 | return await this.decoratee.run(node, api);
|
14 | }
|
15 | catch (error) {
|
16 | api.reportError(node.id, error, api.task.trace);
|
17 | }
|
18 | }
|
19 | }
|
20 | exports.TaskHandler = TaskHandler;
|
21 | exports.createTaskHandler = (decoratee, id) => {
|
22 | return new TaskHandler(decoratee, id);
|
23 | };
|
24 |
|
\ | No newline at end of file |