@acot/utils
Version:
Utility functions for acot.
12 lines (11 loc) • 454 B
JavaScript
;
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;