findLabelWithStrategy function exported ✓ 100.0%
Last updated: 2026-02-24T19:46:21.774Z
Metrics
LOC: 10
Complexity: 3
Params: 3
Coverage: 100.0% (4/4 lines, 67x executed)
Signature
findLabelWithStrategy(
element: HTMLElement,
strategies: ReadonlyArray<LabelStrategy> = DEFAULT_LABEL_STRATEGIES,
): : LabelResult | undefined
Summary
Runs all strategies in order and returns the first match. Uses the provided strategies or falls back to DEFAULT_LABEL_STRATEGIES.
Source Code
export function findLabelWithStrategy(
element: HTMLElement,
strategies: ReadonlyArray<LabelStrategy> = DEFAULT_LABEL_STRATEGIES,
): LabelResult | undefined {
for (const strategy of strategies) {
const result = strategy.find(element);
if (result) return result;
}
return undefined;
}
Dependencies (Outgoing)
| Target | Type |
|---|---|
| Extractor | uses |
| LabelResult | uses |
| LabelStrategy | uses |
| LabelStrategyName | uses |
Impact (Incoming)
| Source | Type |
|---|---|
| findLabel | calls |
| NativeElement | uses |
| matches | uses |
| findAntLabel | uses |
| matches | uses |