*Update dist
This commit is contained in:
parent
47dc0be026
commit
1ba24bee76
|
@ -1,2 +1,3 @@
|
|||
export declare function resolve(domain: string, params: any, force?: boolean): Promise<any>;
|
||||
export declare function ready(): Promise<any>;
|
||||
//# sourceMappingURL=index.d.ts.map
|
|
@ -1 +1 @@
|
|||
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAoBA,wBAAsB,OAAO,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,KAAK,UAAQ,gBASvE"}
|
||||
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAmBA,wBAAsB,OAAO,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,KAAK,UAAQ,gBAavE;AACD,wBAAsB,KAAK,iBAS1B"}
|
|
@ -5,19 +5,31 @@ async function loadLibs() {
|
|||
return;
|
||||
}
|
||||
if (typeof window !== "undefined" && window?.document) {
|
||||
const pkg = (await import("libkernel"));
|
||||
const pkg = await import("libkernel");
|
||||
callModule = pkg.callModule;
|
||||
connectModule = pkg.connectModule;
|
||||
}
|
||||
else {
|
||||
const pkg = (await import("libkmodule"));
|
||||
const pkg = await import("libkmodule");
|
||||
callModule = pkg.callModule;
|
||||
connectModule = pkg.connectModule;
|
||||
}
|
||||
}
|
||||
export async function resolve(domain, params, force = false) {
|
||||
await loadLibs();
|
||||
const [resp, err] = await callModule(DNS_MODULE, "resolve", { domain, params, force });
|
||||
const [resp, err] = await callModule(DNS_MODULE, "resolve", {
|
||||
domain,
|
||||
params,
|
||||
force,
|
||||
});
|
||||
if (err) {
|
||||
throw new Error(err);
|
||||
}
|
||||
return resp;
|
||||
}
|
||||
export async function ready() {
|
||||
await loadLibs();
|
||||
const [resp, err] = await callModule(DNS_MODULE, "ready");
|
||||
if (err) {
|
||||
throw new Error(err);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue