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)
| Source | Type |
|---|---|
| buildField | calls |