mirror of
https://github.com/SukkaW/Surge.git
synced 2026-04-30 01:46:57 +08:00
Refactor: deprecate SSPanel appprofile.php output
This commit is contained in:
@@ -1,19 +1,16 @@
|
||||
import { fetchRemoteTextByLine } from './lib/fetch-text-by-line';
|
||||
import { task } from './trace';
|
||||
|
||||
import { once } from 'foxts/once';
|
||||
import { IPListOutput } from './lib/rules/ip';
|
||||
import { createFileDescription } from './constants/description';
|
||||
|
||||
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>)
|
||||
]);
|
||||
});
|
||||
const getChnCidrPromise = 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>)
|
||||
]);
|
||||
|
||||
export const buildChnCidr = task(require.main === module, __filename)(async (span) => {
|
||||
const [filteredCidr4, cidr6] = await span.traceChildAsync('download chnroutes2', getChnCidrPromise);
|
||||
const [filteredCidr4, cidr6] = await span.traceChildPromise('download chnroutes2', getChnCidrPromise);
|
||||
|
||||
// Can not use SHARED_DESCRIPTION here as different license
|
||||
const description = createFileDescription('CC BY-SA 2.0');
|
||||
|
||||
Reference in New Issue
Block a user