find method ✓ 100.0%

Last updated: 2026-02-24T19:46:21.777Z

Metrics

LOC: 8 Complexity: 3 Params: 1 Coverage: 100.0% (4/4 lines, 71x executed)

Signature

find(element: HTMLElement): : LabelResult | null

Source Code

  find(element: HTMLElement): LabelResult | null {
    if (!element.id) return null;
    const lbl = document.querySelector(
      `label[for="${CSS.escape(element.id)}"]`,
    );
    const text = lbl?.textContent?.trim();
    return text ? { text, strategy: "label[for]" } : null;
  },

Dependencies (Outgoing)

graph LR find["find"] LabelResult["LabelResult"] LabelStrategy["LabelStrategy"] find -->|uses| LabelResult find -->|uses| LabelStrategy style find fill:#dbeafe,stroke:#2563eb,stroke-width:2px click find "51713238cbbee402.html" click LabelResult "476761065111ae2f.html" click LabelStrategy "838d971bd28eb15e.html"
TargetType
LabelResult uses
LabelStrategy uses

No incoming dependencies.