MCPcopy Create free account
hub / github.com/colbymchenry/codegraph / consumerTrigger

Function consumerTrigger

src/ui-server/api/steps.ts:640–652  ·  view source on GitHub ↗
(node: Node)

Source from the content-addressed store, hash-verified

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

Callers 1

buildStepsFunction · 0.85

Calls 5

decoratorNameFunction · 0.85
isGuardDecoratorFunction · 0.85
decoratorLiteralFunction · 0.85
decoratorsMethod · 0.80
basenameFunction · 0.70

Tested by

no test coverage detected