fix(client,testing,build): improve TypeScript compatibility for DNS client parsing and test suite
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user