fix(client,testing,build): improve TypeScript compatibility for DNS client parsing and test suite

This commit is contained in:
2026-04-30 12:48:49 +00:00
parent 510801b109
commit 199dfe7ba3
18 changed files with 1944 additions and 3435 deletions
+4 -3
View File
@@ -248,10 +248,11 @@ export class Smartdns {
return;
}
const returnArray: plugins.tsclass.network.IDnsRecord[] = [];
for (const recordKey in recordsArg) {
for (const record of recordsArg as unknown[]) {
const value = Array.isArray(record) ? record.join('') : String(record);
returnArray.push({
name: recordNameArg,
value: recordsArg[recordKey][0],
value,
type: recordTypeArg,
dnsSecEnabled: false,
});
@@ -280,7 +281,7 @@ export class Smartdns {
public convertDnsTypeNumberToTypeName(
dnsTypeNumberArg: number
): plugins.tsclass.network.TDnsRecordType {
): plugins.tsclass.network.TDnsRecordType | null {
for (const key in this.dnsTypeMap) {
if (this.dnsTypeMap[key] === dnsTypeNumberArg) {
return key as plugins.tsclass.network.TDnsRecordType;