MCPcopy Index your code
hub / github.com/SeleniumHQ/selenium / isElement

Function isElement

javascript/atoms/typescript/get-attribute.ts:81–94  ·  view source on GitHub ↗
(node: unknown, tagName?: string)

Source from the content-addressed store, hash-verified

79 }
80
81 function isElement(node: unknown, tagName?: string): node is Element {
82 const elem = node as { nodeType?: number; tagName?: string } | null;
83 if (!elem || elem.nodeType !== 1) {
84 return false;
85 }
86 if (!tagName) {
87 return true;
88 }
89 const normalizedTag = tagName.toUpperCase();
90 if (node instanceof HTMLFormElement) {
91 return normalizedTag === 'FORM';
92 }
93 return typeof elem.tagName === 'string' && elem.tagName.toUpperCase() === normalizedTag;
94 }
95
96 function isSelectable(element: Element): boolean {
97 if (isElement(element, 'OPTION')) {

Callers 3

isSelectableFunction · 0.70
isSelectedFunction · 0.70
get-attribute.tsFile · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected