mirror of
https://github.com/SukkaW/Surge.git
synced 2025-12-12 17:20:35 +08:00
Chore: minor changes
This commit is contained in:
parent
e694b59832
commit
1209f5c69f
@ -7,10 +7,13 @@ import { task } from './trace';
|
||||
import { exclude } from 'fast-cidr-tools';
|
||||
import { createMemoizedPromise } from './lib/memo-promise';
|
||||
import { CN_CIDR_NOT_INCLUDED_IN_CHNROUTE, NON_CN_CIDR_INCLUDED_IN_CHNROUTE } from './constants/cidr';
|
||||
import { appendArrayInPlace } from './lib/append-array-in-place';
|
||||
|
||||
export const getChnCidrPromise = createMemoizedPromise(async () => {
|
||||
const cidr = await processLineFromReadline(await fetchRemoteTextByLine('https://raw.githubusercontent.com/misakaio/chnroutes2/master/chnroutes.txt'));
|
||||
return exclude([...cidr, ...CN_CIDR_NOT_INCLUDED_IN_CHNROUTE], NON_CN_CIDR_INCLUDED_IN_CHNROUTE, true);
|
||||
|
||||
appendArrayInPlace(cidr, CN_CIDR_NOT_INCLUDED_IN_CHNROUTE);
|
||||
return exclude(cidr, NON_CN_CIDR_INCLUDED_IN_CHNROUTE, true);
|
||||
});
|
||||
|
||||
export const buildChnCidr = task(import.meta.main, import.meta.path)(async (span) => {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user