Refactor: remove Bun fallback

This commit is contained in:
SukkaW
2024-07-24 11:36:14 +08:00
parent bb65a4180c
commit 46ae8e8cd8
5 changed files with 59 additions and 112 deletions

View File

@@ -4,7 +4,8 @@ import { createMemoizedPromise } from './memo-promise';
import { getPublicSuffixListTextPromise } from './download-publicsuffixlist';
import { fileURLToPath } from 'url';
const customFetch = async (url: string | URL) => {
// TODO: node undfici fetch doesn't support file URL reading yet
const customFetch = async (url: URL) => {
const filePath = fileURLToPath(url);
const file = await fsp.readFile(filePath);
return new Blob([file]) as any;