mirror of
https://github.com/SukkaW/Surge.git
synced 2025-12-14 02:00:37 +08:00
Fix: pound sign handling
This commit is contained in:
parent
bae38ea3a8
commit
8ec28f6260
@ -88,8 +88,6 @@ export const buildCdnDownloadConf = task(require.main === module, __filename)(as
|
|||||||
steamDomainSetPromise
|
steamDomainSetPromise
|
||||||
]);
|
]);
|
||||||
|
|
||||||
console.log(JSON.stringify(cdnDomainsList, null, 2));
|
|
||||||
|
|
||||||
// Move S3 domains to download domain set, since S3 files may be large
|
// Move S3 domains to download domain set, since S3 files may be large
|
||||||
appendArrayInPlace(downloadDomainSet, S3OSSDomains);
|
appendArrayInPlace(downloadDomainSet, S3OSSDomains);
|
||||||
appendArrayInPlace(downloadDomainSet, steamDomainSet);
|
appendArrayInPlace(downloadDomainSet, steamDomainSet);
|
||||||
|
|||||||
@ -37,12 +37,6 @@ export function processLine(line: string): string | null {
|
|||||||
*/
|
*/
|
||||||
}
|
}
|
||||||
|
|
||||||
const otherPoundSign = trimmed.indexOf('#');
|
|
||||||
|
|
||||||
if (otherPoundSign > 0) {
|
|
||||||
return trimmed.slice(0, otherPoundSign).trimEnd();
|
|
||||||
}
|
|
||||||
|
|
||||||
return trimmed;
|
return trimmed;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -168,7 +168,13 @@ export class FileOutput {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private async addFromDomainsetPromise(source: MaybePromise<AsyncIterable<string> | Iterable<string> | string[]>) {
|
private async addFromDomainsetPromise(source: MaybePromise<AsyncIterable<string> | Iterable<string> | string[]>) {
|
||||||
for await (const line of await source) {
|
for await (let line of await source) {
|
||||||
|
const otherPoundSign = line.lastIndexOf('#');
|
||||||
|
|
||||||
|
if (otherPoundSign > 0) {
|
||||||
|
line = line.slice(0, otherPoundSign).trimEnd();
|
||||||
|
}
|
||||||
|
|
||||||
if (line[0] === '.') {
|
if (line[0] === '.') {
|
||||||
this.addDomainSuffix(line, true);
|
this.addDomainSuffix(line, true);
|
||||||
} else {
|
} else {
|
||||||
@ -187,7 +193,13 @@ export class FileOutput {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private async addFromRulesetPromise(source: MaybePromise<AsyncIterable<string> | Iterable<string> | string[]>) {
|
private async addFromRulesetPromise(source: MaybePromise<AsyncIterable<string> | Iterable<string> | string[]>) {
|
||||||
for await (const line of await source) {
|
for await (let line of await source) {
|
||||||
|
const otherPoundSign = line.lastIndexOf('#');
|
||||||
|
|
||||||
|
if (otherPoundSign > 0) {
|
||||||
|
line = line.slice(0, otherPoundSign).trimEnd();
|
||||||
|
}
|
||||||
|
|
||||||
const splitted = line.split(',');
|
const splitted = line.split(',');
|
||||||
const type = splitted[0];
|
const type = splitted[0];
|
||||||
const value = splitted[1];
|
const value = splitted[1];
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user