Perf: preload/hoist more promises, make ts happy

This commit is contained in:
SukkaW
2024-01-14 23:47:22 +08:00
parent 6daf8e3bb4
commit a3e1a85c70
7 changed files with 80 additions and 80 deletions

View File

@@ -3,7 +3,7 @@ import { traceAsync } from './trace-runner';
import { createMemoizedPromise } from './memo-promise';
import { getPublicSuffixListTextPromise } from '../download-publicsuffixlist';
const customFetch = (url: string | URL) => Promise.resolve(Bun.file(url));
const customFetch = (url: string | URL): Promise<Blob> => Promise.resolve(Bun.file(url));
export const getGorhillPublicSuffixPromise = createMemoizedPromise(() => traceAsync('create gorhill public suffix instance', async () => {
const [publicSuffixListDat, { default: gorhill }] = await Promise.all([