(element: Element)
| 115 | } |
| 116 | |
| 117 | function isSelected(element: Element): boolean { |
| 118 | if (isElement(element, 'OPTION')) { |
| 119 | return (element as HTMLOptionElement).selected; |
| 120 | } |
| 121 | const type = (element as HTMLInputElement).type?.toLowerCase(); |
| 122 | if (type === 'checkbox' || type === 'radio') { |
| 123 | return (element as HTMLInputElement).checked; |
| 124 | } |
| 125 | return false; |
| 126 | } |
| 127 | |
| 128 | function isObject(value: unknown): boolean { |
| 129 | return value !== null && (typeof value === 'object' || typeof value === 'function'); |