tryPlaceholder function ✓ 100.0%

Last updated: 2026-03-05T12:26:14.062Z

Metrics

LOC: 11 Complexity: 2 Params: 1 Coverage: 100.0% (4/4 lines, 79x executed)

Signature

tryPlaceholder(el: Element): : SmartSelector | null

Source Code

function tryPlaceholder(el: Element): SmartSelector | null {
  const placeholder = el.getAttribute("placeholder");
  if (!placeholder) return null;

  const tag = el.tagName.toLowerCase();
  return {
    value: `${tag}[placeholder="${escapeCSS(placeholder)}"]`,
    strategy: "placeholder",
    description: `placeholder="${placeholder}"`,
  };
}

Dependencies (Outgoing)

graph LR tryPlaceholder["tryPlaceholder"] escapeCSS["escapeCSS"] tryPlaceholder -->|calls| escapeCSS style tryPlaceholder fill:#dbeafe,stroke:#2563eb,stroke-width:2px click tryPlaceholder "1ef71348c5527bf9.html" click escapeCSS "44646aa96f30257e.html"
TargetType
escapeCSS calls

No incoming dependencies.