chore: fix ts error

This commit is contained in:
afc163 2020-12-08 17:56:31 +08:00
parent 9f5a832235
commit bbdb345542

View File

@ -21,6 +21,9 @@ function ariaConvert(wrapper: CheerIO) {
const matches = new Map();
function process(entry: CheerIOElement) {
if (entry.type === 'text') {
return;
}
const { attribs, children } = entry;
if (matches.has(entry)) return;
matches.set(entry, true);
@ -31,7 +34,9 @@ function ariaConvert(wrapper: CheerIO) {
}
// Loop children
if (!children) return;
if (!children) {
return;
}
(Array.isArray(children) ? children : [children]).forEach(process);
}