mirror of
https://github.com/SukkaW/Surge.git
synced 2026-01-29 01:51:52 +08:00
Refactor: drop all Bun.write usage
This commit is contained in:
@@ -5,6 +5,8 @@ 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';
|
||||
|
||||
import fsp from 'fs/promises';
|
||||
|
||||
export const buildInternalReverseChnCIDR = task(import.meta.main, import.meta.path)(async () => {
|
||||
const cidr = await getChnCidrPromise();
|
||||
|
||||
@@ -19,5 +21,9 @@ export const buildInternalReverseChnCIDR = task(import.meta.main, import.meta.pa
|
||||
)
|
||||
);
|
||||
|
||||
return Bun.write(path.resolve(import.meta.dir, '../Internal/reversed-chn-cidr.txt'), `${reversedCidr.join('\n')}\n`);
|
||||
return fsp.writeFile(
|
||||
path.resolve(import.meta.dir, '../Internal/reversed-chn-cidr.txt'),
|
||||
reversedCidr.join('\n') + '\n',
|
||||
{ encoding: 'utf-8' }
|
||||
);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user