extractRadioOptions function infrastructure ✓ 100.0%

Last updated: 2026-03-04T23:21:38.385Z

Metrics

LOC: 22 Complexity: 4 Params: 2 Coverage: 100.0% (7/7 lines, 2x executed)

Signature

extractRadioOptions( wrapper: HTMLElement, ): : Array<{ value: string; text: string }> | undefined

Source Code

function extractRadioOptions(
  wrapper: HTMLElement,
): Array<{ value: string; text: string }> | undefined {
  const labels = wrapper.querySelectorAll<HTMLElement>(
    ".ant-radio-wrapper, .ant-radio-button-wrapper",
  );

  const opts = Array.from(labels)
    .map((label) => {
      const input = label.querySelector<HTMLInputElement>(
        "input[type='radio']",
      );
      const text = label.textContent?.trim() ?? "";
      return {
        value: input?.value || text,
        text,
      };
    })
    .filter((o) => o.text);

  return opts.length > 0 ? opts : undefined;
}

No outgoing dependencies.

Impact (Incoming)

graph LR extractRadioOptions["extractRadioOptions"] buildField["buildField"] buildField -->|calls| extractRadioOptions style extractRadioOptions fill:#dbeafe,stroke:#2563eb,stroke-width:2px click extractRadioOptions "1022a5863703a14b.html" click buildField "0731bf36655a7ca8.html"
SourceType
buildField calls