*Update dist

This commit is contained in:
Derrick Hammer 2022-08-18 18:28:56 -04:00
parent 8a88a43c20
commit e06c86720f
Signed by: pcfreak30
GPG Key ID: C997C339BE476FF2
4 changed files with 24 additions and 0 deletions

1
dist/index.d.ts vendored
View File

@ -1,2 +1,3 @@
import type { ResolverModule } from "@lumeweb/resolver-common";
export declare function setup(rm: ResolverModule): void;
export * from "./resolverRegistry.js";

1
dist/index.js vendored
View File

@ -30,3 +30,4 @@ async function handleResolve(aq) {
}
aq.respond(ret);
}
export * from "./resolverRegistry.js";

8
dist/resolverRegistry.d.ts vendored Normal file
View File

@ -0,0 +1,8 @@
import { DNSResult, ResolverOptions } from "@lumeweb/resolver-common";
export declare class ResolverRegistry {
resolve(
domain: string,
options?: ResolverOptions,
bypassCache?: boolean
): Promise<DNSResult>;
}

14
dist/resolverRegistry.js vendored Normal file
View File

@ -0,0 +1,14 @@
import { DNS_RECORD_TYPE, resolverError, } from "@lumeweb/resolver-common";
import { resolve } from "@lumeweb/kernel-dns-client";
export class ResolverRegistry {
async resolve(domain, options = { type: DNS_RECORD_TYPE.DEFAULT }, bypassCache = false) {
let result;
try {
result = await resolve(domain, options, bypassCache);
}
catch (e) {
return resolverError(e);
}
return result;
}
}