extractCheckboxOptions function infrastructure ✓ 100.0%

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

Metrics

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

Signature

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

Source Code

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

  const opts = Array.from(labels)
    .map((label) => {
      const input = label.querySelector<HTMLInputElement>(
        "input[type='checkbox']",
      );
      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 extractCheckboxOptions["extractCheckboxOptions"] buildField["buildField"] buildField -->|calls| extractCheckboxOptions style extractCheckboxOptions fill:#dbeafe,stroke:#2563eb,stroke-width:2px click extractCheckboxOptions "c3e26b44e414ea6a.html" click buildField "2a40f31d63f1a0b7.html"
SourceType
buildField calls