function e(e,t=9){if(t<=0)return[];const r=e.trim(),n=(new DOMParser).parseFromString(r,"application/xml"),o=n.querySelector("parsererror");if(null!=o)throw new Error(o.innerHTML);return Array.from(n.documentElement.querySelectorAll("item")).map((e=>{const t=e.querySelector("title").textContent,r=e.querySelector("link").textContent,n=e.querySelector("pubDate").textContent,o=new Date(n).toISOString(),l=e.querySelector("description").childNodes[0].data,i=(new DOMParser).parseFromString(l,"text/html");return{title:t,link:r,date:o,banner:i.body?.querySelector(".wp-post-image")?.src??null,description:i.body?.querySelectorAll("p")?.[1]?.textContent??i.body.textContent}})).slice(0,t)}export{e as parseRssFeed};
//# sourceMappingURL=xml-parser.js.map
