Skip to content

Commit

Permalink
fix: build type error
Browse files Browse the repository at this point in the history
  • Loading branch information
maaaathis committed Nov 28, 2024
1 parent 32424f9 commit 8cafd24
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions lib/resolvers/AuthoritativeResolver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,29 +43,33 @@ class AuthoritativeResolver extends DnsResolver {
case 'TXT':
if (Array.isArray(record.data)) {
return record.data
.map((item) => (item instanceof Buffer ? item.toString() : item))
.map((item) =>
item instanceof Buffer ? item.toString() : String(item)
)
.join(' ');
} else if (record.data instanceof Buffer) {
return record.data.toString();
} else {
return record.data;
return String(record.data);
}
case 'CAA':
return `${record.data.flags} ${record.data.tag} "${record.data.value}"`;
case 'DNSKEY':
return `${record.data.flags} ${
record.data.algorithm
} ${record.data.key.toString('hex')}`;
} ${record.data.key.toString('base64')}`;
case 'DS':
return `${record.data.keyTag} ${record.data.algorithm} ${
record.data.digestType
} ${record.data.digest.toString('hex')}`;
} ${record.data.digest.toString('hex').toUpperCase()}`;
case 'MX':
return `${record.data.preference} ${record.data.exchange}`;
case 'NAPTR':
return `${record.data.order} ${record.data.preference} "${record.data.flags}" "${record.data.services}" "${record.data.regexp}" ${record.data.replacement}`;
case 'NS':
return record.data;
case 'RRSIG':
return `${record.data.typeCovered} ${record.data.algorithm} ${record.data.labels} ${record.data.originalTTL} ${record.data.expiration} ${record.data.inception} ${record.data.keyTag} ${record.data.signersName} ${record.data.signature.toString('base64')}`;
case 'SOA':
return `${record.data.mname} ${record.data.rname} ${record.data.serial} ${record.data.refresh} ${record.data.retry} ${record.data.expire} ${record.data.minimum}`;
case 'SRV':
Expand Down

0 comments on commit 8cafd24

Please sign in to comment.