*Update dist

This commit is contained in:
Derrick Hammer 2022-08-29 01:05:35 -04:00
parent eb7d84cd40
commit a3465ab9f0
Signed by: pcfreak30
GPG Key ID: C997C339BE476FF2
2 changed files with 5 additions and 8 deletions

2
dist/index.d.ts vendored
View File

@ -2,7 +2,7 @@ import {
AbstractResolverModule, AbstractResolverModule,
DNSResult, DNSResult,
ResolverOptions, ResolverOptions,
} from "@lumeweb/resolver-common"; } from "@lumeweb/libresolver";
export default class Handshake extends AbstractResolverModule { export default class Handshake extends AbstractResolverModule {
private buildBlacklist; private buildBlacklist;
resolve( resolve(

11
dist/index.js vendored
View File

@ -1,6 +1,5 @@
import tldEnum from "@lumeweb/tld-enum"; import tldEnum from "@lumeweb/tld-enum";
import { AbstractResolverModule, DNS_RECORD_TYPE, isDomain, isIp, isPromise, normalizeDomain, resolverEmptyResponse, resolveSuccess, } from "@lumeweb/resolver-common"; import { AbstractResolverModule, DNS_RECORD_TYPE, isDomain, isIp, isPromise, normalizeDomain, resolverEmptyResponse, resolveSuccess, ensureUniqueRecords, getTld, } from "@lumeweb/libresolver";
import { getTld } from "@lumeweb/resolver-common";
const HIP5_EXTENSIONS = ["eth", "_eth"]; const HIP5_EXTENSIONS = ["eth", "_eth"];
export default class Handshake extends AbstractResolverModule { export default class Handshake extends AbstractResolverModule {
async buildBlacklist() { async buildBlacklist() {
@ -75,9 +74,7 @@ export default class Handshake extends AbstractResolverModule {
} }
} }
} }
records = [ records = ensureUniqueRecords(records);
...new Set(records.map((item) => JSON.stringify(item))),
].map((item) => JSON.parse(item));
if (0 < records.length) { if (0 < records.length) {
return resolveSuccess(records); return resolveSuccess(records);
} }
@ -163,8 +160,8 @@ export default class Handshake extends AbstractResolverModule {
} }
} }
} }
async query(tld, force) { async query(tld, bypassCache) {
const query = this.resolver.rpcNetwork.query("getnameresource", "hns", [tld], force); const query = this.resolver.rpcNetwork.wisdomQuery("getnameresource", "hns", [tld], bypassCache);
const resp = await query.result; const resp = await query.result;
// @ts-ignore // @ts-ignore
return resp?.records || []; return resp?.records || [];