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)

graph LR findLabelWithStrategy["findLabelWithStrategy"] Extractor["Extractor"] LabelResult["LabelResult"] LabelStrategy["LabelStrategy"] LabelStrategyName["LabelStrategyName"] findLabelWithStrategy -->|uses| Extractor findLabelWithStrategy -->|uses| LabelResult findLabelWithStrategy -->|uses| LabelStrategy findLabelWithStrategy -->|uses| LabelStrategyName style findLabelWithStrategy fill:#dbeafe,stroke:#2563eb,stroke-width:2px click findLabelWithStrategy "8f614323e886c07b.html" click Extractor "5386f4a2b1ff68ed.html" click LabelResult "476761065111ae2f.html" click LabelStrategy "838d971bd28eb15e.html" click LabelStrategyName "825286d414927278.html"
TargetType
Extractor uses
LabelResult uses
LabelStrategy uses
LabelStrategyName uses

Impact (Incoming)

graph LR findLabelWithStrategy["findLabelWithStrategy"] findLabel["findLabel"] NativeElement["NativeElement"] matches["matches"] findAntLabel["findAntLabel"] findLabel -->|calls| findLabelWithStrategy NativeElement -->|uses| findLabelWithStrategy matches -->|uses| findLabelWithStrategy findAntLabel -->|uses| findLabelWithStrategy matches -->|uses| findLabelWithStrategy style findLabelWithStrategy fill:#dbeafe,stroke:#2563eb,stroke-width:2px click findLabelWithStrategy "8f614323e886c07b.html" click findLabel "e101c4a52af07427.html" click NativeElement "8fb34e112c670c35.html" click matches "19835198bf6ff31b.html" click findAntLabel "4446526a4a01afd7.html"
SourceType
findLabel calls
NativeElement uses
matches uses
findAntLabel uses
matches uses