Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function fetch(what, where, recurse) {
return DomUtils.getText(
DomUtils.getElementsByTagName(what, where, recurse, 1)
).trim();
}
if (isName(element, srcProperty)) {
return resolveUrlProperty(DOM.getAttributeValue(element, 'src'));
}
if (isName(element, hrefProperty)) {
return resolveUrlProperty(DOM.getAttributeValue(element, 'href'));
}
if (isName(element, [ 'object' ])) {
return resolveUrlProperty(DOM.getAttributeValue(element, 'data'));
}
if (isName(element, [ 'data', 'meter' ])) {
return resolveNumberProperty(DOM.getAttributeValue(element, 'value'));
}
if (isName(element, [ 'time' ])) {
return resolveDateProperty(DOM.getAttributeValue(element, 'datetime'));
}
var value = DOM.getText(element);
if (value || strict) {
return resolveProperty(value);
}
return resolveProperty('');
}
function extractFromElementAsync(cache, element) {
if (isStyleElement(element)) {
DOMUtils.removeElement(element);
const css = DOMUtils.getText(element);
const resultPromise = cache.compileAsync(css);
return resultPromise;
} else if (isLocalStylesheet(element)) {
DOMUtils.removeElement(element);
const relativeURL = DOMUtils.getAttributeValue(element, 'href');
const resultPromise = cache.loadAsync(relativeURL);
return resultPromise;
} else
return Promise.resolve({});
}
function fetch(what, where, recurse) {
return DomUtils.getText(
DomUtils.getElementsByTagName(what, where, recurse, 1)
).trim();
}
get textContent() {
return getText(this._dom)
}