Skip to content

Commit

Permalink
Chore: minor changes
Browse files Browse the repository at this point in the history
  • Loading branch information
SukkaW committed Jan 4, 2025
1 parent ba14856 commit 1899946
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
16 changes: 8 additions & 8 deletions Build/build-common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -113,20 +113,20 @@ function transformDomainset(parentSpan: Span, sourcePath: string) {
if (res === $skip) return;

const id = basename;
const [title, descriptions, lines] = res;
const [title, incomingDescriptions, lines] = res;

let description: string[];
if (descriptions.length) {
description = SHARED_DESCRIPTION.slice();
description.push('');
appendArrayInPlace(description, descriptions);
let finalDescriptions: string[];
if (incomingDescriptions.length) {
finalDescriptions = SHARED_DESCRIPTION.slice();
finalDescriptions.push('');
appendArrayInPlace(finalDescriptions, incomingDescriptions);
} else {
description = SHARED_DESCRIPTION;
finalDescriptions = SHARED_DESCRIPTION;
}

return new DomainsetOutput(span, id)
.withTitle(title)
.withDescription(description)
.withDescription(finalDescriptions)
.addFromDomainset(lines)
.write();
}
Expand Down
6 changes: 3 additions & 3 deletions Build/build-speedtest-domainset.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import { readFileIntoProcessedArray } from './lib/fetch-text-by-line';

import { DomainsetOutput } from './lib/create-file';
import { OUTPUT_SURGE_DIR } from './constants/dir';
import { createMemoizedPromise } from './lib/memo-promise';
import { newQueue } from '@henrygd/queue';

const KEYWORDS = [
Expand Down Expand Up @@ -111,6 +110,7 @@ const PREDEFINE_DOMAINS = [
'.speedtestwnet.com.br',
'.speedtest.moack.co.kr',
'speedtest.mtnetworks.mn',
'.speedtest.waicore.com',
// Cloudflare
'.speed.cloudflare.com',
// Wi-Fi Man
Expand Down Expand Up @@ -187,7 +187,7 @@ async function querySpeedtestApi(keyword: string) {
}
}

const getSpeedtestHostsGroupsPromise = createMemoizedPromise(() => Promise.all(KEYWORDS.flatMap(querySpeedtestApi)));
const getSpeedtestHostsGroupsPromise = Promise.all(KEYWORDS.flatMap(querySpeedtestApi));

export const buildSpeedtestDomainSet = task(require.main === module, __filename)(async (span) => {
const output = new DomainsetOutput(span, 'speedtest')
Expand All @@ -200,7 +200,7 @@ export const buildSpeedtestDomainSet = task(require.main === module, __filename)
.addFromDomainset(PREDEFINE_DOMAINS)
.addFromDomainset(await readFileIntoProcessedArray(path.resolve(OUTPUT_SURGE_DIR, 'domainset/speedtest.conf')));

const hostnameGroup = await span.traceChildPromise('get speedtest hosts groups', getSpeedtestHostsGroupsPromise());
const hostnameGroup = await span.traceChildPromise('get speedtest hosts groups', getSpeedtestHostsGroupsPromise);

hostnameGroup.forEach(hostname => output.bulkAddDomain(hostname));

Expand Down
2 changes: 1 addition & 1 deletion Build/build-stream-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export function createRulesetForStreamService(span: Span,
fileId: string, title: string,
streamServices: Array<import('../Source/stream').StreamService>) {
return span.traceChildAsync(fileId, async (childSpan) => Promise.all([
// Domains
// Domains
new RulesetOutput(childSpan, fileId, 'non_ip')
.withTitle(`Sukka's Ruleset - Stream Services: ${title}`)
.withDescription([
Expand Down

0 comments on commit 1899946

Please sign in to comment.