feat(baoyu-url-to-markdown): vendor baoyu-fetch runtime

This commit is contained in:
Jim Liu 宝玉
2026-04-21 13:39:09 -05:00
parent 2f09f48726
commit d6442e1ab4
45 changed files with 7960 additions and 45 deletions
@@ -0,0 +1,9 @@
export function isXHost(hostname: string): boolean {
return ["x.com", "www.x.com", "twitter.com", "www.twitter.com"].includes(hostname);
}
export function extractStatusId(url: URL): string | undefined {
const match = url.pathname.match(/\/(?:status|article)\/(\d+)/);
return match?.[1];
}