Refactor: use foxts more
Some checks failed
Build / Build (push) Has been cancelled
Build / Diff output (push) Has been cancelled
Build / Deploy to Cloudflare Pages (3.114.6) (push) Has been cancelled
Build / Deploy to GitHub and GitLab (push) Has been cancelled

This commit is contained in:
SukkaW
2025-06-02 00:44:07 +08:00
parent 017ff38b5e
commit bdc1f5ec82
9 changed files with 33 additions and 57 deletions

View File

@@ -1,6 +1,6 @@
import { task } from './trace';
import { SHARED_DESCRIPTION } from './constants/description';
import { createMemoizedPromise } from './lib/memo-promise';
import { once } from 'foxts/once';
import { RulesetOutput } from './lib/rules/ruleset';
import Worktank from 'worktank';
@@ -44,7 +44,7 @@ const pool = new Worktank({
}
});
export const getMicrosoftCdnRulesetPromise = createMemoizedPromise<[domains: string[], domainSuffixes: string[]]>(async () => {
export const getMicrosoftCdnRulesetPromise = once<Promise<[domains: string[], domainSuffixes: string[]]>>(async () => {
const res = await pool.exec(
'getMicrosoftCdnRuleset',
[import.meta.url]