Skip to content

Commit

Permalink
Fixes MDNS exception (#1547)
Browse files Browse the repository at this point in the history
  • Loading branch information
Apollon77 authored Dec 20, 2024
1 parent 8f983ad commit 755393a
Showing 1 changed file with 22 additions and 19 deletions.
41 changes: 22 additions & 19 deletions packages/protocol/src/mdns/MdnsScanner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -782,25 +782,28 @@ export class MdnsScanner implements Scanner {
}
}

return {
operational: combinedAnswers.operational
? Object.fromEntries(
Object.entries(combinedAnswers.operational).map(([recordType, records]) => [
recordType,
Array.from(records.values()),
]),
)
: undefined,
commissionable: combinedAnswers.commissionable
? Object.fromEntries(
Object.entries(combinedAnswers.commissionable).map(([recordType, records]) => [
recordType,
Array.from(records.values()),
]),
)
: undefined,
addresses: combinedAnswers.addresses,
};
const result: StructuredDnsAnswers = {};
if (combinedAnswers.operational) {
result.operational = Object.fromEntries(
Object.entries(combinedAnswers.operational).map(([recordType, records]) => [
recordType,
Array.from(records.values()),
]),
);
}
if (combinedAnswers.commissionable) {
result.commissionable = Object.fromEntries(
Object.entries(combinedAnswers.commissionable).map(([recordType, records]) => [
recordType,
Array.from(records.values()),
]),
);
}
if (combinedAnswers.addresses) {
result.addresses = combinedAnswers.addresses;
}

return result;
}

/**
Expand Down

0 comments on commit 755393a

Please sign in to comment.