mirror of
https://github.com/SukkaW/Surge.git
synced 2026-01-29 01:51:52 +08:00
Refactor: rework tracer
This commit is contained in:
@@ -5,7 +5,7 @@ import { exclude, merge } from 'fast-cidr-tools';
|
||||
import { getChnCidrPromise } from './build-chn-cidr';
|
||||
import { NON_CN_CIDR_INCLUDED_IN_CHNROUTE, RESERVED_IPV4_CIDR } from './constants/cidr';
|
||||
|
||||
export const buildInternalReverseChnCIDR = task(import.meta.path, async () => {
|
||||
export const buildInternalReverseChnCIDR = task(import.meta.main, import.meta.path)(async () => {
|
||||
const cidrPromise = getChnCidrPromise();
|
||||
const peeked = Bun.peek(cidrPromise);
|
||||
const cidr: string[] = peeked === cidrPromise
|
||||
@@ -25,7 +25,3 @@ export const buildInternalReverseChnCIDR = task(import.meta.path, async () => {
|
||||
|
||||
return Bun.write(path.resolve(import.meta.dir, '../Internal/reversed-chn-cidr.txt'), `${reversedCidr.join('\n')}\n`);
|
||||
});
|
||||
|
||||
if (import.meta.main) {
|
||||
buildInternalReverseChnCIDR();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user