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,11 +1,11 @@
import { fetchRemoteTextByLine } from './lib/fetch-text-by-line';
import { task } from './trace';
import { createMemoizedPromise } from './lib/memo-promise';
import { once } from 'foxts/once';
import { IPListOutput } from './lib/rules/ip';
import { createFileDescription } from './constants/description';
export const getChnCidrPromise = createMemoizedPromise(async function getChnCidr() {
export const getChnCidrPromise = once(async function getChnCidr() {
return Promise.all([
fetchRemoteTextByLine('https://chnroutes2.cdn.skk.moe/chnroutes.txt', true).then(Array.fromAsync<string>),
fetchRemoteTextByLine('https://gaoyifan.github.io/china-operator-ip/china6.txt', true).then(Array.fromAsync<string>)