From 1551e0aa75cba001f5cf257e7a25ae734f1aea52 Mon Sep 17 00:00:00 2001 From: Derrick Hammer Date: Sun, 19 Feb 2023 18:03:47 -0500 Subject: [PATCH] *Update dist --- dist/resolverModule.d.ts | 6 +++--- dist/resolverModule.d.ts.map | 2 +- dist/resolverModule.js | 10 ++++++++-- 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/dist/resolverModule.d.ts b/dist/resolverModule.d.ts index 00bf895..61d39e8 100644 --- a/dist/resolverModule.d.ts +++ b/dist/resolverModule.d.ts @@ -18,7 +18,7 @@ export interface ResolverModule extends ResolverModuleConstructor { options: ResolverOptions, bypassCache: boolean ): Promise; - getSupportedTlds(): string[]; + getSupportedTlds(): string[] | Promise; } export declare abstract class AbstractResolverModule { protected resolver: ResolverRegistry; @@ -28,8 +28,8 @@ export declare abstract class AbstractResolverModule { options: ResolverOptions, bypassCache: boolean ): Promise; - getSupportedTlds(): string[]; - isTldSupported(domain: string): boolean; + getSupportedTlds(): string[] | Promise; + isTldSupported(domain: string): boolean | Promise; } export {}; //# sourceMappingURL=resolverModule.d.ts.map diff --git a/dist/resolverModule.d.ts.map b/dist/resolverModule.d.ts.map index b9429f5..9f10140 100644 --- a/dist/resolverModule.d.ts.map +++ b/dist/resolverModule.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"resolverModule.d.ts","sourceRoot":"","sources":["../src/resolverModule.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAG7D,OAAO,OAAO,gBAAgB;IAC5B,IAAI,SAAS,IAAI,GAAG,CAAC,cAAc,CAAC,GAAG,OAAO,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC,CAAC;IACpE,OAAO,CACL,MAAM,EAAE,MAAM,EACd,OAAO,CAAC,EAAE,eAAe,EACzB,WAAW,CAAC,EAAE,OAAO,GACpB,OAAO,CAAC,SAAS,CAAC;IACrB,QAAQ,CAAC,QAAQ,EAAE,cAA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,OAAO,CACL,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,eAAe,EACxB,WAAW,EAAE,OAAO,GACnB,OAAO,CAAC,SAAS,CAAC,CAAC;IAEtB,gBAAgB,IAAI,MAAM,EAAE,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC;CAClD;AAGD,8BAAsB,sBAAsB;IAC1C,SAAS,CAAC,QAAQ,EAAE,gBAAgB,CAAC;gBAEzB,QAAQ,EAAE,gBAAgB;IAItC,QAAQ,CAAC,OAAO,CACd,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,eAAe,EACxB,WAAW,EAAE,OAAO,GACnB,OAAO,CAAC,SAAS,CAAC;IAErB,gBAAgB,IAAI,MAAM,EAAE,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC;IAIhD,cAAc,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC;CAU3D"} \ No newline at end of file diff --git a/dist/resolverModule.js b/dist/resolverModule.js index 5457c46..bb7dcf4 100644 --- a/dist/resolverModule.js +++ b/dist/resolverModule.js @@ -1,4 +1,4 @@ -import { getTld } from "./util.js"; +import { getTld, isPromise } from "./util.js"; // ts-ignore export class AbstractResolverModule { resolver; @@ -9,6 +9,12 @@ export class AbstractResolverModule { return []; } isTldSupported(domain) { - return this.getSupportedTlds().includes(getTld(domain)); + let supported = this.getSupportedTlds(); + if (isPromise(supported)) { + return supported.then((supported) => { + return supported.includes(getTld(domain)); + }); + } + return supported.includes(getTld(domain)); } }