playwright-fluent
Version:
Fluent API around playwright
18 lines (17 loc) • 648 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.getPreviousSiblingsOf = void 0;
async function getPreviousSiblingsOf(handles) {
const result = [];
for (let index = 0; index < handles.length; index++) {
const element = handles[index];
const jsHandle = await element.evaluateHandle((node) => node.previousElementSibling);
const previousSiblingElement = jsHandle.asElement();
if (previousSiblingElement === null) {
continue;
}
result.push(previousSiblingElement);
}
return result;
}
exports.getPreviousSiblingsOf = getPreviousSiblingsOf;