mirror of
https://github.com/SukkaW/Surge.git
synced 2026-09-12 18:44:36 +08:00
Housekeeping
This commit is contained in:
@@ -18,7 +18,7 @@ const fileEqual = createCompareSource(fileEqualWithCommentComparator);
|
||||
*/
|
||||
async function isPreviousOutputEqual(span: Span, linesA: string[], filePath: string, contentHash: string | null) {
|
||||
// readFileByLine will not include last empty line. So we always pop the linesA for comparison purpose
|
||||
if (linesA.length > 0 && linesA[linesA.length - 1] === '') {
|
||||
if (linesA.length > 0 && linesA.at(-1) === '') {
|
||||
linesA.pop();
|
||||
}
|
||||
|
||||
|
||||
@@ -154,7 +154,7 @@ const agent = new Agent({
|
||||
|
||||
console.log('[fetch retry]', 'schedule retry', { statusCode, retryTimeout, errorCode, url: opts.origin });
|
||||
// eslint-disable-next-line sukka/prefer-timer-id -- won't leak
|
||||
setTimeout(() => cb(null), retryTimeout);
|
||||
setTimeout(cb, retryTimeout, null);
|
||||
}
|
||||
// errorCodes: ['UND_ERR_HEADERS_TIMEOUT', 'ECONNRESET', 'ECONNREFUSED', 'ENOTFOUND', 'ENETDOWN', 'ENETUNREACH', 'EHOSTDOWN', 'EHOSTUNREACH', 'EPIPE', 'ETIMEDOUT']
|
||||
}),
|
||||
|
||||
@@ -56,7 +56,7 @@ export function writeDataToStrategies(data: StrategyWriteData, strategies: BaseW
|
||||
const domainEntries: Array<[domain: string, subdomain: boolean]> = [];
|
||||
for (let j = 0, len = data.domains.length; j < len; j++) {
|
||||
const line = data.domains[j];
|
||||
const includeSubdomain = line.codePointAt(0) === 46; /* '.' */
|
||||
const includeSubdomain = line.charCodeAt(0) === 46; /* '.' */
|
||||
const d = domainToASCII(includeSubdomain ? line.slice(1) : line);
|
||||
if (d) domainEntries.push([d, includeSubdomain]);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user