mirror of
https://github.com/SukkaW/Surge.git
synced 2025-12-13 01:30:37 +08:00
20 lines
504 B
TypeScript
20 lines
504 B
TypeScript
import type * as tldts from 'tldts';
|
|
|
|
export const looseTldtsOpt: Parameters<typeof tldts.getSubdomain>[1] = {
|
|
allowPrivateDomains: false,
|
|
extractHostname: false,
|
|
validateHostname: false,
|
|
detectIp: false,
|
|
mixedInputs: false
|
|
};
|
|
|
|
export const loosTldOptWithPrivateDomains: Parameters<typeof tldts.getSubdomain>[1] = {
|
|
...looseTldtsOpt,
|
|
allowPrivateDomains: true
|
|
};
|
|
|
|
export const normalizeTldtsOpt: Parameters<typeof tldts.getSubdomain>[1] = {
|
|
allowPrivateDomains: true,
|
|
detectIp: true
|
|
};
|