@@ -26,28 +26,38 @@ export async function getDirs(path: string): Promise<string[]> {
2626
2727export async function getDomains (
2828 client : ExtendedClient ,
29- options ? : {
29+ options : {
3030 excludeIAD ?: boolean ;
3131 excludeUnderscores ?: boolean ;
3232 excludeFlags ?: ( "internal" | "reserved" ) [ ] ;
3333 hasFlags ?: ( "internal" | "reserved" ) [ ] ;
3434 hasRecords ?: ( "A" | "AAAA" | "CAA" | "CNAME" | "DS" | "MX" | "NS" | "SRV" | "TLSA" | "TXT" | "URL" ) [ ] ;
35- result_limit ?: number ;
35+ resultLimit ?: number ;
3636 subdomain ?: string | null ;
3737 subdomainStartsWith ?: string ;
3838 username ?: string | null ;
39+ } = {
40+ excludeIAD : false ,
41+ excludeUnderscores : false ,
42+ excludeFlags : [ ] ,
43+ hasFlags : [ ] ,
44+ hasRecords : [ ] ,
45+ resultLimit : 0 ,
46+ subdomain : null ,
47+ subdomainStartsWith : "" ,
48+ username : null
3949 }
4050) : Promise < Domain [ ] > {
4151 const {
42- excludeIAD = false ,
43- excludeUnderscores = false ,
44- excludeFlags = [ ] ,
45- hasFlags = [ ] ,
46- hasRecords = [ ] ,
47- result_limit = 0 ,
48- subdomain = null ,
49- subdomainStartsWith = "" ,
50- username = null
52+ excludeIAD,
53+ excludeUnderscores,
54+ excludeFlags,
55+ hasFlags,
56+ hasRecords,
57+ resultLimit ,
58+ subdomain,
59+ subdomainStartsWith,
60+ username
5161 } = options ;
5262
5363 if (
@@ -82,11 +92,14 @@ export async function getDomains(
8292 return true ;
8393 } ) ;
8494
85- return result_limit <= 0 ? results : results . slice ( 0 , result_limit ) ;
95+ return resultLimit <= 0 ? results : results . slice ( 0 , resultLimit ) ;
8696}
8797
88- export async function getUsernames ( client : ExtendedClient , options ?: { result_limit : number } ) : Promise < string [ ] > {
89- const { result_limit = 0 } = options ;
98+ export async function getUsernames (
99+ client : ExtendedClient ,
100+ options : { resultLimit : number } = { resultLimit : 0 }
101+ ) : Promise < string [ ] > {
102+ const { resultLimit } = options ;
90103
91104 if (
92105 ! client . rawAPICache ||
@@ -104,7 +117,7 @@ export async function getUsernames(client: ExtendedClient, options?: { result_li
104117 new Set ( client . rawAPICache . map ( ( entry : Domain ) => entry . owner . username . toLowerCase ( ) ) )
105118 ) . sort ( ) ;
106119
107- return result_limit <= 0 ? results : results . slice ( 0 , result_limit ) ;
120+ return resultLimit <= 0 ? results : results . slice ( 0 , resultLimit ) ;
108121}
109122
110123export function loadHandlers ( client : ExtendedClient ) : void {
0 commit comments