(node: Node)
| 638 | |
| 639 | /** A job, an event, a message or a schedule that fires a function, from its decorators. */ |
| 640 | const consumerTrigger = async (node: Node): Promise<WireStepTrigger | null> => { |
| 641 | if (node.kind !== 'function' && node.kind !== 'method') return null; |
| 642 | const decs = await calls.decorators(node); |
| 643 | if (!decs) return null; |
| 644 | for (const d of decs.own) { |
| 645 | const name = decoratorName(d); |
| 646 | const last = name.split('.').pop() ?? name; |
| 647 | if (!CONSUMER_DECORATOR.test(name) && !CONSUMER_DECORATOR.test(last)) continue; |
| 648 | const guards = [...decs.class, ...decs.own].filter((x) => x !== d && isGuardDecorator(x)); |
| 649 | return { kind: 'decorator', name, of: decoratorLiteral(d), in: basename(node.filePath), ...(guards.length > 0 ? { after: guards } : {}) }; |
| 650 | } |
| 651 | return null; |
| 652 | }; |
| 653 | |
| 654 | /** |
| 655 | * The decision a site's innermost condition belongs to. The innermost guard |
no test coverage detected