UNPKG

@upstart.gg/sdk

Version:

You can test the CLI without recompiling by running:

18 lines (16 loc) 711 B
import { createPlaceholderReplacer, placeholderRx } from "../../utils.js"; import { parseFeed } from "@rowanmanning/feed-parser"; //#region src/shared/datasources/external/rss/fetcher.ts const fetchRss = async ({ options, pageAttributes: attr }) => { const replacer = createPlaceholderReplacer(attr); const url = options.url.replace(placeholderRx, replacer); const content = await (await fetch(url)).text(); return parseFeed(content)?.items.map((item) => ({ ...item, pubDate: item.published ? item.published.toISOString() : (/* @__PURE__ */ new Date()).toISOString() })) ?? []; }; var fetcher_default = fetchRss; //#endregion export { fetcher_default as default }; //# sourceMappingURL=fetcher.js.map