UNPKG

@acot/utils

Version:
12 lines (11 loc) 454 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.isElementMatches = void 0; const isElementMatches = async (element, selectors) => { const targets = Array.isArray(selectors) ? selectors : [selectors]; if (targets.length === 0) { return false; } return await element.evaluate((el, list) => list.some((selector) => el.matches(selector)), targets); }; exports.isElementMatches = isElementMatches;