makeSwitch function infrastructure
Last updated: 2026-03-01T23:25:47.092Z
Metrics
LOC: 10
Complexity: 4
Params: 2
Signature
makeSwitch(checked = false, disabled = false)
Source Code
function makeSwitch(checked = false, disabled = false) {
const btn = document.createElement("button");
btn.className = "ant-switch";
if (checked) btn.classList.add("ant-switch-checked");
if (disabled) btn.classList.add("ant-switch-disabled");
btn.setAttribute("role", "switch");
btn.setAttribute("aria-checked", checked ? "true" : "false");
btn.id = "switch-1";
return btn;
}
No outgoing dependencies.
Impact (Incoming)
| Source | Type |
|---|---|
| makeCheckboxGroup | calls |