UNPKG

playwright-fluent

Version:
18 lines (17 loc) 576 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.getParentsOf = void 0; async function getParentsOf(handles) { const result = []; for (let index = 0; index < handles.length; index++) { const element = handles[index]; const jsHandle = await element.evaluateHandle((node) => node.parentElement); const parentElement = jsHandle.asElement(); if (parentElement === null) { continue; } result.push(parentElement); } return result; } exports.getParentsOf = getParentsOf;