mirror of
https://github.com/SukkaW/Surge.git
synced 2026-01-29 10:01:54 +08:00
Collect speedtest.net endpoint
This commit is contained in:
@@ -1,11 +1,13 @@
|
||||
// @ts-check
|
||||
const { promises: fsPromises } = require('fs');
|
||||
const fse = require('fs-extra');
|
||||
|
||||
/**
|
||||
* @param {string[]} linesA
|
||||
* @param {string} filePath
|
||||
*/
|
||||
async function compareAndWriteFile(linesA, filePath) {
|
||||
await fse.ensureFile(filePath);
|
||||
const linesB = (await fsPromises.readFile(filePath, { encoding: 'utf-8' })).split('\n');
|
||||
|
||||
if (!stringArrayCompare(linesA, linesB)) {
|
||||
|
||||
Reference in New Issue
Block a user