pickBestSelector function exported

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

Metrics

LOC: 7 Complexity: 3 Params: 3

Signature

pickBestSelector( selectors: SmartSelector[] | undefined, fallbackCSS: string, ): : string

Summary

Picks the best selector from a SmartSelector array. Returns the first one (highest priority) or the raw CSS fallback.

Source Code

export function pickBestSelector(
  selectors: SmartSelector[] | undefined,
  fallbackCSS: string,
): string {
  if (!selectors || selectors.length === 0) return fallbackCSS;
  return selectors[0].value;
}

No outgoing dependencies.

Impact (Incoming)

graph LR pickBestSelector["pickBestSelector"] createElement["createElement"] escapeString["escapeString"] createElement -->|uses| pickBestSelector escapeString -->|uses| pickBestSelector escapeString -->|uses| pickBestSelector escapeString -->|uses| pickBestSelector style pickBestSelector fill:#dbeafe,stroke:#2563eb,stroke-width:2px click pickBestSelector "2ffd4aaee2d537ec.html" click createElement "de25c17a3a1487d3.html" click escapeString "6e0df1d8c5dd6d48.html"
SourceType
createElement uses
escapeString uses
escapeString uses
escapeString uses