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,12 @@
export function normalizeUrl(input: string): URL {
try {
return new URL(input);
} catch {
throw new Error(`Invalid URL: ${input}`);
}
}
export function sanitizeFilename(input: string): string {
return input.replace(/[^a-zA-Z0-9._-]+/g, "-").replace(/^-+|-+$/g, "") || "document";
}