mirror of
https://github.com/SukkaW/Surge.git
synced 2026-01-29 01:51:52 +08:00
Update CDN / Download / Domestic Hosts
This commit is contained in:
@@ -39,3 +39,7 @@ export const surgeRulesetToClashClassicalTextRuleset = (rules: string[] | Set<st
|
||||
export const surgeDomainsetToClashDomainset = (domainset: string[]) => {
|
||||
return domainset.map(i => (i[0] === '.' ? `+${i}` : i));
|
||||
};
|
||||
|
||||
export const surgeDomainsetToClashRuleset = (domainset: string[]) => {
|
||||
return domainset.map(i => (i[0] === '.' ? `DOMAIN-SUFFIX,${i.slice(1)}` : `DOMAIN,${i}`));
|
||||
};
|
||||
|
||||
@@ -27,8 +27,8 @@ export function isProbablyIpv4(hostname: string): boolean {
|
||||
|
||||
return (
|
||||
numberOfDots === 3
|
||||
&& hostname.charCodeAt(0) !== 46
|
||||
&& /* '.' */ hostname.charCodeAt(hostname.length - 1) !== 46 /* '.' */
|
||||
&& hostname.charCodeAt(0) !== 46 /* '.' */
|
||||
&& hostname.charCodeAt(hostname.length - 1) !== 46 /* '.' */
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user