mirror of
https://github.com/SukkaW/Surge.git
synced 2026-01-29 01:51:52 +08:00
Refactor: drop Bun.peek usage as much as possible
This commit is contained in:
@@ -6,11 +6,7 @@ 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.main, import.meta.path)(async () => {
|
||||
const cidrPromise = getChnCidrPromise();
|
||||
const peeked = Bun.peek(cidrPromise);
|
||||
const cidr: string[] = peeked === cidrPromise
|
||||
? await cidrPromise
|
||||
: (peeked as string[]);
|
||||
const cidr = await getChnCidrPromise();
|
||||
|
||||
const reversedCidr = merge(
|
||||
exclude(
|
||||
|
||||
Reference in New Issue
Block a user