Почему TypeScript предупреждает, что Property 'attr' does not exist on type 'CheerioElement'
?
async function inlineImages(serializedSvg: string) {
const $ = cheerio.load(serializedSvg);
await Promise.all(
Array.from($('image[href^="http"]')).map(async (el: CheerioElement) => {
const url = el.attr("href"); // <--- HERE
if (!url) {
return;
}
const data = await requestBase64(url);
if (!data) {
return;
}
el.attr("href", data); // <--- AND HERE
})
);
return serializedSvg;
}