pickRandomOption function infrastructure ✓ 100.0%
Last updated: 2026-03-04T23:21:38.386Z
Metrics
LOC: 13
Complexity: 3
Params: 0
Coverage: 100.0% (6/6 lines, 0x executed)
Signature
pickRandomOption(): : HTMLElement | null
Summary
Pick a random non-disabled option from THIS wrapper's dropdown.
Source Code
function pickRandomOption(): HTMLElement | null {
const dd = getOwnDropdown();
if (!dd) return null;
const options = Array.from(
dd.querySelectorAll<HTMLElement>(
".ant-select-item-option:not(.ant-select-item-option-disabled)",
),
);
if (options.length > 0) {
return options[Math.floor(Math.random() * options.length)];
}
return null;
}
Dependencies (Outgoing)
| Target | Type |
|---|---|
| getOwnDropdown | calls |
Impact (Incoming)
| Source | Type |
|---|---|
| selectOption | calls |