*Switch to libresolver

*Use ensureUniqueRecords
This commit is contained in:
Derrick Hammer 2022-08-29 01:03:00 -04:00
parent cef692b7ec
commit 6d60a68674
Signed by: pcfreak30
GPG Key ID: C997C339BE476FF2
1 changed files with 5 additions and 6 deletions

View File

@ -10,9 +10,10 @@ import {
resolverEmptyResponse,
ResolverOptions,
resolveSuccess,
} from "@lumeweb/resolver-common";
import { getTld } from "@lumeweb/resolver-common";
import { DNSRecord } from "@lumeweb/resolver-common";
ensureUniqueRecords,
DNSRecord,
getTld,
} from "@lumeweb/libresolver";
const HIP5_EXTENSIONS = ["eth", "_eth"];
@ -120,9 +121,7 @@ export default class Handshake extends AbstractResolverModule {
}
}
records = [
...new Set(records.map((item: DNSRecord) => JSON.stringify(item))),
].map((item) => JSON.parse(item));
records = ensureUniqueRecords(records);
if (0 < records.length) {
return resolveSuccess(records);