playwright-fluent
Version:
Fluent API around playwright
18 lines (17 loc) • 522 B
JavaScript
Object.defineProperty(exports, "__esModule", { value: true });
exports.getInnerTextOfHandle = void 0;
async function getInnerTextOfHandle(selector) {
if (!selector) {
return null;
}
const result = await selector.evaluate((el) => {
const inputElement = el;
return inputElement && inputElement.innerText;
});
if (typeof result === 'string') {
return result.replace(/\s/g, ' ');
}
return result;
}
exports.getInnerTextOfHandle = getInnerTextOfHandle;
;